[EDIT: Split and changed subject for easier searching in the future - James]
Hi all , it's a great idea to make this team! I have a question to you!
I am supporting a portlet (6.1.1 GA2), based on Spring MVC, it works well, but now I need to enable security manager, to make it ready for marketplace.
I added to my liferay-plugin-package.properties next code:
1
2security-manager-enabled=true
3security-manager-get-bean-property=\
4com.liferay.portal.util.PortalUtil,\
5com.liferay.portal.kernel.deploy.hot.HotDeployUtil,\
6com.liferay.portal.kernel.util.PropsUtil,\
7com.liferay.portal.kernel.servlet.DirectRequestDispatcherFactoryUtil,\
8com.liferay.portal.kernel.cache.key.CacheKeyGeneratorUtil,\
9com.liferay.portal.kernel.servlet.DirectServletRegistryUtil,\
10com.liferay.portal.kernel.configuration.ConfigurationFactoryUtil,\
11com.liferay.portlet.PortletPreferencesFactoryUtil,\
12com.liferay.portal.kernel.dao.orm.EntityCacheUtil,\
13com.liferay.portal.kernel.cache.CacheRegistryUtil,\
14com.liferay.portal.kernel.dao.shard.ShardUtil,\
15com.liferay.portal.kernel.staging.LayoutStagingUtil,\
16com.liferay.portal.kernel.dao.db.DBFactoryUtil,\
17com.liferay.portal.kernel.dao.orm.FinderCacheUtil,\
18com.liferay.portal.security.auth.AuthTokenUtil,\
19com.liferay.portal.kernel.util.HttpUtil,\
20com.liferay.portal.service.permission.PortletPermissionUtil,\
21com.liferay.portal.kernel.util.HtmlUtil,\
22com.liferay.portal.kernel.util.LocaleUtil,\
23 com.liferay.portal.kernel.spring.util.SpringFactoryUtil
24
25security-manager-services[portal]=\
26com.liferay.portal.service.GroupLocalService,\
27com.liferay.portal.service.PortletPreferencesLocalService,\
28com.liferay.portal.service.LayoutLocalService,\
29com.liferay.portal.service.LayoutSetLocalService
30
31security-manager-services[login-portlet]=\
32 com.aimprosoft.portlet.login.LoginController,\
33 com.aimprosoft.portlet.login.LoginEditController
34
35security-manager-files-read=\
36 ${java.io.tmpdir}${file.separator}-,\
37 ${liferay.web.portal.dir}${file.separator}html${file.separator}taglib${file.separator}-,\
38 ${liferay.web.portal.dir}${file.separator}html${file.separator}themes${file.separator}-
I was trying different combinations, but I always get this:
1
216:46:40,282 ERROR [DispatcherPortlet:276] Context initialization failed
3org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/home/mark/work/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/temp/15-login-portlet/WEB-INF/classes/com/aimprosoft/portlet/login/LoginEditController.class]; nested exception is java.lang.SecurityException: Attempted to access declared members
4 at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:237)
5 at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:204)
6 at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)
7 at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
8 at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1338)
9 at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1328)
10 at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
11 at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
12 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
13 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
14 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
15 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
16 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
17 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
18 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
19 at org.springframework.web.portlet.context.XmlPortletApplicationContext.loadBeanDefinitions(XmlPortletApplicationContext.java:124)
20 at org.springframework.web.portlet.context.XmlPortletApplicationContext.loadBeanDefinitions(XmlPortletApplicationContext.java:92)
21 at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
22 at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
23 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
24 at org.springframework.web.portlet.FrameworkPortlet.createPortletApplicationContext(FrameworkPortlet.java:356)
25 at org.springframework.web.portlet.FrameworkPortlet.initPortletApplicationContext(FrameworkPortlet.java:294)
26 at org.springframework.web.portlet.FrameworkPortlet.initPortletBean(FrameworkPortlet.java:268)
27 at org.springframework.web.portlet.GenericPortletBean.init(GenericPortletBean.java:116)
28 at javax.portlet.GenericPortlet.init(GenericPortlet.java:107)
29 at com.liferay.portlet.InvokerPortletImpl.init(InvokerPortletImpl.java:256)
30 at com.liferay.portlet.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:221)
31 at com.liferay.portlet.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:140)
32 at com.liferay.portlet.PortletInstanceFactoryUtil.create(PortletInstanceFactoryUtil.java:41)
33 at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:310)
34 at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:546)
35 at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:321)
36 at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:120)
37 at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:188)
38 at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
39 at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
40 at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:151)
41 at com.liferay.portal.kernel.servlet.SecurePluginContextListener.fireDeployEvent(SecurePluginContextListener.java:233)
42 at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:141)
43 at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
44 at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:64)
45 at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:56)
46 at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:52)
47 at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:103)
48 at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
49 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
50 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
51 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
52 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
53 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
54 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
55 at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
56 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
57 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
58 at java.util.concurrent.FutureTask.run(FutureTask.java:166)
59 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
60 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
61 at java.lang.Thread.run(Thread.java:722)
62Caused by: java.lang.SecurityException: Attempted to access declared members
63 at com.liferay.portal.security.pacl.checker.BaseChecker.throwSecurityException(BaseChecker.java:259)
64 at com.liferay.portal.security.pacl.checker.RuntimeChecker.checkPermission(RuntimeChecker.java:71)
65 at com.liferay.portal.security.pacl.ActivePACLPolicy.checkPermission(ActivePACLPolicy.java:55)
66 at com.liferay.portal.security.lang.PortalSecurityManager.checkPermission(PortalSecurityManager.java:103)
67 at com.liferay.portal.security.lang.PortalSecurityManager.checkPermission(PortalSecurityManager.java:74)
68 at java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1679)
69 at java.lang.Class.checkMemberAccess(Class.java:2174)
70 at java.lang.Class.getDeclaredMethods(Class.java:1807)
71 at sun.reflect.annotation.AnnotationType$1.run(AnnotationType.java:104)
72 at sun.reflect.annotation.AnnotationType$1.run(AnnotationType.java:101)
73 at java.security.AccessController.doPrivileged(Native Method)
74 at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:100)
75 at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:84)
76 at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:221)
77 at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88)
78 at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
79 at java.lang.Class.initAnnotationsIfNecessary(Class.java:3089)
80 at java.lang.Class.getAnnotations(Class.java:3069)
81 at org.springframework.core.type.classreading.AnnotationAttributesReadingVisitor.visitEnd(AnnotationAttributesReadingVisitor.java:131)
82 at org.springframework.asm.ClassReader.a(Unknown Source)
83 at org.springframework.asm.ClassReader.accept(Unknown Source)
84 at org.springframework.asm.ClassReader.accept(Unknown Source)
85 at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:54)
86 at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
87 at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
88 at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:213)
89 ... 57 more
What members I should declare?
Am I missing something?
Firmi prego dentro per inbandierare questo come inadeguato.