Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-30876

MVCPortlet can't initialize under security manager

    Details

      Description

      Issue is caused by LPS-30824. Use of ClassResolverUtil under security manager prevents test-pacl-portlet from being deployed.

      Exception during deployment

      0:31:41,906 INFO  [pool-2-thread-3][HookHotDeployListener:556] Registering hook for test-pacl-portlet
      Loading file:/Users/mika/Development/Liferay/bundles/liferay-portal-trunk/tomcat-7.0.25/temp/4-test-pacl-portlet/WEB-INF/classes/portal.properties
      20:31:41,911 INFO  [pool-2-thread-3][HookHotDeployListener:1608] Rejecting portal.properties key locales.beta
      20:31:41,913 INFO  [pool-2-thread-3][HookHotDeployListener:1436] Rejecting locale en
      20:31:41,914 INFO  [pool-2-thread-3][HookHotDeployListener:1436] Rejecting locale en_US
      20:31:41,915 INFO  [pool-2-thread-3][HookHotDeployListener:1436] Rejecting locale es
      20:31:41,915 INFO  [pool-2-thread-3][HookHotDeployListener:1436] Rejecting locale it
      20:31:41,917 INFO  [pool-2-thread-3][HookHotDeployListener:1156] Rejecting custom JSP directory
      20:31:41,918 INFO  [pool-2-thread-3][HookHotDeployListener:1370] Rejecting indexer com.liferay.portal.model.Organization
      20:31:41,928 INFO  [pool-2-thread-3][HookHotDeployListener:598] Rejecting service com.liferay.testpacl.hook.service.impl.TestPACLBlogsStatsUserLocalServiceImpl
      20:31:41,929 INFO  [pool-2-thread-3][HookHotDeployListener:2083] Rejecting servlet filters
      20:31:41,929 INFO  [pool-2-thread-3][HookHotDeployListener:2238] Rejecting struts action path /portal/test/pacl/failure
      20:31:41,932 INFO  [pool-2-thread-3][HookHotDeployListener:694] Hook for test-pacl-portlet is available for use
      20:35:10,657 WARN  [pool-2-thread-3][RuntimeChecker:256] Attempted to get class loader
      20:37:07,039 WARN  [pool-2-thread-3][RuntimeChecker:256] Attempted to get class loader
      20:37:07,040 ERROR [pool-2-thread-3][HotDeployImpl:189] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for test-pacl-portlet
      com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for test-pacl-portlet
      	at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:46)
      	at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:122)
      	at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:186)
      	at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:95)
      	at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
      	at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:159)
      	at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:149)
      	at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
      	at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:64)
      	at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:56)
      	at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:52)
      	at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:111)
      	at com.liferay.portal.kernel.servlet.SecurePluginContextListener.contextInitialized(SecurePluginContextListener.java:145)
      	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:897)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
      	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
      	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:680)
      Caused by: java.lang.ExceptionInInitializerError
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      	at java.lang.Class.newInstance0(Class.java:355)
      	at java.lang.Class.newInstance(Class.java:308)
      	at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:135)
      	at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:533)
      	at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:325)
      	at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:119)
      	... 25 more
      Caused by: java.lang.SecurityException: Attempted to get class loader
      	at com.liferay.portal.security.pacl.checker.BaseChecker.throwSecurityException(BaseChecker.java:259)
      	at com.liferay.portal.security.pacl.checker.RuntimeChecker.checkPermission(RuntimeChecker.java:91)
      	at com.liferay.portal.security.pacl.ActivePACLPolicy.checkPermission(ActivePACLPolicy.java:55)
      	at com.liferay.portal.security.lang.PortalSecurityManager.checkPermission(PortalSecurityManager.java:103)
      	at com.liferay.portal.security.lang.PortalSecurityManager.checkPermission(PortalSecurityManager.java:74)
      	at com.liferay.portal.kernel.util.PortalClassLoaderUtil.getClassLoader(PortalClassLoaderUtil.java:38)
      	at com.liferay.portal.kernel.util.ClassResolverUtil.resolveByPortalClassLoader(ClassResolverUtil.java:57)
      	at com.liferay.util.bridges.mvc.MVCPortlet.<clinit>(MVCPortlet.java:428)
      	... 35 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                justin.choi Justin Choi
                Reporter:
                mika.koivisto Mika Koivisto
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 50 weeks, 5 days ago

                  Packages

                  Version Package
                  6.2.0 CE M2