Combination View Flat View Tree View
toggle
Cameron McBride
How to fix PACL: Attempted to access declared members
October 31, 2012 6:21 PM
Answer

Cameron McBride

Rank: Youngling

Posts: 0

Join Date: February 8, 2011

Recent Posts

I am getting this error:
1org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [C:\liferay\liferay-portal-6.1.20-ee-ga2\tomcat-7.0.27\temp\13-my-portlet\WEB-INF\classes\com\test\my\controller\MyDisplayController.class]; nested exception is java.lang.SecurityException: Attempted to access declared members


And this is my entire controller!
 1@RequestMapping("VIEW")
 2@Controller("myDisplayController")
 3public class MyDisplayController {
 4
 5    @RenderMapping
 6    public String myDisplay(final RenderRequest renderRequest, final Locale locale) {
 7       
 8        return "hello";
 9    }
10   
11}


Works great with security off and soars into the gutter with it on.
Attachments: error.txt (8.6k)
Cameron McBride
RE: How to fix PACL: Attempted to access declared members
November 1, 2012 9:29 AM
Answer

Cameron McBride

Rank: Youngling

Posts: 0

Join Date: February 8, 2011

Recent Posts

Looks like it is this bug:
http://issues.liferay.com/browse/LPS-30769
Florencia Gadea
RE: How to fix PACL: Attempted to access declared members
February 27, 2013 6:30 AM
Answer

Florencia Gadea

Rank: Youngling

Posts: 0

Join Date: March 27, 2012

Recent Posts

Hi All,

I have to same exception, I even tried to fix it with this patch, with no luck.

Here is the exception:

  114:22:10,964 INFO  [pool-2-thread-8][HotDeployImpl:178] Deploying google-analytics-portlet from queue
  214:22:10,965 INFO  [pool-2-thread-8][PluginPackageUtil:1033] Reading plugin package for google-analytics-portlet
  314:22:11,097 WARN  [pool-2-thread-8][FileChecker:256] Attempted to read file /home/flor/global-configuration.properties
  4Loading file:/home/flor/liferayProyects/liferay.6.1.1/bundles/tomcat-7.0.27/temp/8-google-analytics-portlet/WEB-INF/classes/portlet.properties
  5Loading file:/home/flor/liferayProyects/liferay.6.1.1/bundles/tomcat-7.0.27/temp/8-google-analytics-portlet/WEB-INF/classes/service.properties
  614:22:12,870 INFO  [pool-2-thread-8][ClpSerializer:86] Unable to locate deployment context from portal properties
  7Loading file:/home/flor/liferayProyects/liferay.6.1.1/bundles/tomcat-7.0.27/temp/8-google-analytics-portlet/WEB-INF/classes/portlet.properties
  8Feb 27, 2013 2:22:12 PM org.apache.catalina.core.ApplicationContext log
  9INFO: Initializing Spring root WebApplicationContext
 1014:22:12,875 WARN  [pool-2-thread-8][FileChecker:256] Attempted to read file /home/flor/global-configuration.properties
 1114:22:12,877 WARN  [pool-2-thread-8][FileChecker:256] Attempted to read file /home/flor/service-ext.properties
 12Loading file:/home/flor/liferayProyects/liferay.6.1.1/bundles/tomcat-7.0.27/temp/8-google-analytics-portlet/WEB-INF/classes/service.properties
 13Loading file:/home/flor/liferayProyects/liferay.6.1.1/bundles/tomcat-7.0.27/temp/8-google-analytics-portlet/WEB-INF/classes/service.properties
 1414:22:14,446 INFO  [DispatcherPortlet:102] Initializing portlet 'googleanalytics'
 1514:22:14,521 WARN  [pool-2-thread-8][RuntimeChecker:256] Attempted to access declared members
 1614:22:14,522 ERROR [pool-2-thread-8][PortletBagFactory:313] java.lang.SecurityException: Attempted to access declared members
 17java.lang.SecurityException: Attempted to access declared members
 18        at com.liferay.portal.security.pacl.checker.BaseChecker.throwSecurityException(BaseChecker.java:259)
 19        at com.liferay.portal.security.pacl.checker.RuntimeChecker.checkPermission(RuntimeChecker.java:67)
 20        at com.liferay.portal.security.pacl.ActivePACLPolicy.checkPermission(ActivePACLPolicy.java:55)
 21        at com.liferay.portal.security.lang.PortalSecurityManager.checkPermission(PortalSecurityManager.java:162)
 22        at com.liferay.portal.security.lang.PortalSecurityManager.checkPermission(PortalSecurityManager.java:133)
 23        at com.liferay.portal.security.lang.PortalSecurityManager.checkMemberAccess(PortalSecurityManager.java:128)
 24        at java.lang.Class.checkMemberAccess(Class.java:2176)
 25        at java.lang.Class.getDeclaredMethods(Class.java:1809)
 26        at org.springframework.util.ReflectionUtils.findMethod(ReflectionUtils.java:154)
 27        at org.springframework.util.ClassUtils.getMostSpecificMethod(ClassUtils.java:730)
 28        at org.springframework.beans.ExtendedBeanInfo.<init>(ExtendedBeanInfo.java:153)
 29        at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:224)
 30        at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:149)
 31        at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:324)
 32        at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1055)
 33        at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:924)
 34        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
 35        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:62)
 36        at org.springframework.web.portlet.GenericPortletBean.init(GenericPortletBean.java:112)
 37        at javax.portlet.GenericPortlet.init(GenericPortlet.java:107)
 38        at com.liferay.portlet.InvokerPortletImpl.init(InvokerPortletImpl.java:256)
 39        at com.liferay.portlet.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:221)
 40        at com.liferay.portlet.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:140)
 41        at com.liferay.portlet.PortletInstanceFactoryUtil.create(PortletInstanceFactoryUtil.java:41)
 42        at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:310)
 43        at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:546)
 44        at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:321)
 45        at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:120)
 46        at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:188)
 47        at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
 48        at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
 49        at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:151)
 50        at com.liferay.portal.kernel.servlet.SecurePluginContextListener.fireDeployEvent(SecurePluginContextListener.java:233)
 51        at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:141)
 52        at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
 53        at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:64)
 54        at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:56)
 55        at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:52)
 56        at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:103)
 57        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
 58        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
 59        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 60        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
 61        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
 62        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
 63        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
 64        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
 65        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 66        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
 67        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
 68        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
 69        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 70        at java.lang.Thread.run(Thread.java:679)
 7114:22:14,523 INFO  [DispatcherPortlet:102] Initializing portlet 'googleanalytics'
 7214:22:14,523 WARN  [pool-2-thread-8][RuntimeChecker:256] Attempted to access declared members
 7314:22:14,524 ERROR [pool-2-thread-8][HotDeployImpl:191] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for google-analytics-portlet
 74com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for google-analytics-portlet
 75        at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:46)
 76        at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:123)
 77        at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:188)
 78        at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
 79        at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
 80        at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:151)
 81        at com.liferay.portal.kernel.servlet.SecurePluginContextListener.fireDeployEvent(SecurePluginContextListener.java:233)
 82        at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:141)
 83        at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
 84        at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:64)
 85        at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:56)
 86        at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:52)
 87        at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:103)
 88        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
 89        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
 90        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 91        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
 92        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
 93        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
 94        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
 95       at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
 96        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 97        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
 98        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
 99        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
100        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
101        at java.lang.Thread.run(Thread.java:679)
102Caused by: java.lang.SecurityException: Attempted to access declared members
103        at com.liferay.portal.security.pacl.checker.BaseChecker.throwSecurityException(BaseChecker.java:259)
104        at com.liferay.portal.security.pacl.checker.RuntimeChecker.checkPermission(RuntimeChecker.java:67)
105        at com.liferay.portal.security.pacl.ActivePACLPolicy.checkPermission(ActivePACLPolicy.java:55)
106        at com.liferay.portal.security.lang.PortalSecurityManager.checkPermission(PortalSecurityManager.java:162)
107        at com.liferay.portal.security.lang.PortalSecurityManager.checkPermission(PortalSecurityManager.java:133)
108        at com.liferay.portal.security.lang.PortalSecurityManager.checkMemberAccess(PortalSecurityManager.java:128)
109        at java.lang.Class.checkMemberAccess(Class.java:2176)
110        at java.lang.Class.getDeclaredMethods(Class.java:1809)
111        at org.springframework.util.ReflectionUtils.findMethod(ReflectionUtils.java:154)
112        at org.springframework.util.ClassUtils.getMostSpecificMethod(ClassUtils.java:730)
113        at org.springframework.beans.ExtendedBeanInfo.<init>(ExtendedBeanInfo.java:153)
114        at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:224)
115        at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:149)
116        at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:324)
117        at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1055)
118        at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:924)
119        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
120        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:62)
121        at org.springframework.web.portlet.GenericPortletBean.init(GenericPortletBean.java:112)
122        at javax.portlet.GenericPortlet.init(GenericPortlet.java:107)
123        at com.liferay.portlet.InvokerPortletImpl.init(InvokerPortletImpl.java:256)
124        at com.liferay.portlet.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:221)
125        at com.liferay.portlet.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:140)
126        at com.liferay.portlet.PortletInstanceFactoryUtil.create(PortletInstanceFactoryUtil.java:41)
127        at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortletApp(PortletHotDeployListener.java:598)
128        at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:328)
129        at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:120)
130        ... 25 more


Can anyone help me?
Raymond Augé
RE: How to fix PACL: Attempted to access declared members
February 27, 2013 6:47 AM
Answer

Raymond Augé

Rank: Youngling

Posts: 0

Join Date: February 7, 2005

Recent Posts

This issue is being addressed as part of the PACL sprint we've have been on.

The vast majority of the issues posted here have to do with managing java "reflection" operations, as is the case here.

Expect that this will be addressed soon.
Florencia Gadea
RE: How to fix PACL: Attempted to access declared members
February 27, 2013 6:49 AM
Answer

Florencia Gadea

Rank: Youngling

Posts: 0

Join Date: March 27, 2012

Recent Posts

Great!

Please post when this is ready.

Cheers,

Flor.
Raymond Augé
RE: How to fix PACL: Attempted to access declared members
February 27, 2013 6:52 AM
Answer

Raymond Augé

Rank: Youngling

Posts: 0

Join Date: February 7, 2005

Recent Posts

Here is the story (jira issue) capturing all the underlying tasks to correct several issues with PACL:

http://issues.liferay.com/browse/LPS-33047

(More tasks will be appear as I parcel out the code into consumable/reviewable pieces. All of this work is being backported to 6.1 branches)
Florencia Gadea
RE: How to fix PACL: Attempted to access declared members
February 27, 2013 7:03 AM
Answer

Florencia Gadea

Rank: Youngling

Posts: 0

Join Date: March 27, 2012

Recent Posts

Thanks!
Victor Zorin
RE: How to fix PACL: Attempted to access declared members
March 12, 2013 11:36 PM
Answer

Victor Zorin

Rank: Youngling

Posts: 0

Join Date: April 14, 2008

Recent Posts

Hi Ray

What would be the best way to find out which declarations are missing in liferay-plugin-package.propeties.

At the moment, all we get with security-manager-enabled=true during deploy time is:
 103:03:28,552 WARN  [pool-2-thread-3][RuntimeChecker:256] Attempted to access declared members
 203:03:28,556 ERROR [pool-2-thread-3][BasePortalLifecycle:45] javax.servlet.UnavailableException
 3javax.servlet.UnavailableException
 4        at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:880)
 5        at org.apache.portals.bridges.struts.PortletServlet.initModulePlugIns(PortletServlet.java:121)
 6        at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
 7        at javax.servlet.GenericServlet.init(GenericServlet.java:160)
 8        at org.apache.portals.bridges.struts.PortletServlet.init(PortletServlet.java:55)
 9        at com.liferay.portal.kernel.servlet.SecureServlet.doPortalInit(SecureServlet.java:95)
10        at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)


This is a very large enterprise-scale portlet (liferay struts-based) with access to external services, there could be too many of points of security crossings so blind copying of of configuration from existing marketplace applications would not bring much help.

And in this specific case I assume that security manager has not even reached our implementation classes yet, portlet fails to deploy.
Some static initalizations in Liferay struts bridges?

Ray, would you suggest any debugging/workaround tips, may be we can override some of your classes to produce a better stack trace?

-------------------------------------------
EDITED: I attempted to have a look how Liferay configures own portlets for Security Manager, so I 'purchased' Web Form CE, had a look inside and found that it is not set for use under PACL at all.

PS. Is it also feasible for Liferay to bundle all own portlets with security features, so at least two positive outcomes can be achieved:
1). Marketplace App developers can see how it should be done in real applications, not just in primitive test/demo cases
2). If Liferay cannot make own portlets to work with PACL, more resources will be thrown into this area.
Raymond Augé
RE: How to fix PACL: Attempted to access declared members
March 13, 2013 8:48 AM
Answer

Raymond Augé

Rank: Youngling

Posts: 0

Join Date: February 7, 2005

Recent Posts

Hey Victor,

The issue you are currently facing is one which has no current work around, other than:

A) disable PACL
B ) completely re-implement all the libraries you use in such a way that they don't use reflection :/
C) wait for Liferay to solve the issues

i.e. neither of A) or B ) are really feasible

Toward option C) we're really very close to having PACL version 2 (PACLv2) complete, and have done the following:

1) solved all the reflection issues
2) written a policy generation tool baked into Liferay portal to make it trivial to deal with the policy. The portal effectively does all the work for you. (next updates will contain this tool)
3) written documentation for the policy generation tool (which will be available when PACLv2 is made available)
4) written close to 200 integration tests that thoroughly test PACLv2
5) tested PACLv2 with complex frameworks like JSF (all supported implementations), pure Spring MVC, Liferay Service Builder, on other complex plugins like Kaleo web, etc.
6) tested PACLv2 on Oracle JDK 6 & 7, OpenJDK JDK 6 & 7, IBM JDK 6 & 7

The goal for when PACLv2 is available to Market Place developers is that with a matter of hours all the issues you have all been facing simply vanish. Within a few more hours, you have generated valid policies for your apps making it possible to submit your apps for review.

I know you have all been very patient with this process which has not exactly been an inspiring one. I simply beg a little more patience with the knowledge that we are putting every ounce of effort we can muster into resolving the PACL issues.
Victor Zorin
RE: How to fix PACL: Attempted to access declared members
March 13, 2013 3:24 PM
Answer

Victor Zorin

Rank: Youngling

Posts: 0

Join Date: April 14, 2008

Recent Posts

Thanks for good clarification Ray.
Victor Zorin
RE: How to fix PACL: Attempted to access declared members
March 18, 2013 4:05 AM
Answer

Victor Zorin

Rank: Youngling

Posts: 0

Join Date: April 14, 2008

Recent Posts

We did more investigation on this specific deployment error, and it looks like commons-beanutils.jar library is causing the above mentioned error during portlet initialization.
Once we remove it, the portlet deploys properly, but of course portlet cannot operate without it (in struts framework).
I wonder whether we can declare any security-manager-xxx-property so we can explicitly tell PACL to allow such calls.

Forums

To access the Developer Forum, please login to your Liferay.com account if you are already a registered developer or register to become a developer.