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

The module framework boot delegation permits com.sun.* which is too broad

Details

    Description

      Problem Background

      This problem is caused by the following value in portal.properties:

      module.framework.properties.org.osgi.framework.bootdelegation=\
      __redirected,\
      com.sun.*,\
      com.yourkit.*,\
      sun.*
      

      Specifically com.sun.* is too broad because it causes the WildFly parent classloader (which includes Mojarra out-of-the-box) to include com.sun.faces.* classes in OSGi module ClassLoaders. The fix is to narrow the scope to whatever com.sun packages are needed.

      Steps to Reproduce:

      1) Copy the attached war to the $LIFERAY_HOME/deploy folder
      2) Add the portlet to a page (jsf-applicant-portlet)

      Expected results:

      • No errors upon deploy or registration of the portlet

      Actual Results:

      16:59:28,588 INFO  [javax.enterprise.resource.webcontainer.jsf.config] Initializing Mojarra 2.2.12-jbossorg-2 20150729-1131 for context '/o/jsf-applicant-portlet-4.0.0'
      16:59:28,609 INFO  [javax.enterprise.resource.webcontainer.jsf.application] JSF1048: PostConstruct/PreDestroy annotations present.  ManagedBeans methods marked with these annotations will have said annotations processed.
      16:59:28,615 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] Critical error during deployment: : com.sun.faces.config.ConfigurationException: Factory 'javax.faces.application.ApplicationFactory' was not configured properly.
              at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:330)
              at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:236)
              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:439)
              at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227)
              at com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletContextListenerExceptionAdapter.contextInitialized(ServletContextListenerExceptionAdapter.java:51)
              at sun.reflect.GeneratedMethodAccessor917.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:497)
              at org.eclipse.equinox.http.servlet.internal.registration.ListenerRegistration$EventListenerInvocationHandler.invoke(ListenerRegistration.java:132)
              at com.sun.proxy.$Proxy521.contextInitialized(Unknown Source)
              at org.eclipse.equinox.http.servlet.internal.context.ContextController.doAddListenerRegistration(ContextController.java:359)
              at org.eclipse.equinox.http.servlet.internal.context.ContextController.addListenerRegistration(ContextController.java:312)
              at org.eclipse.equinox.http.servlet.internal.customizer.ContextListenerTrackerCustomizer.addingService(ContextListenerTrackerCustomizer.java:67)
              at org.eclipse.equinox.http.servlet.internal.customizer.ContextListenerTrackerCustomizer.addingService(ContextListenerTrackerCustomizer.java:1)
              at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
              at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
              at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
              at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
              at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
              at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:917)
              at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
              at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:482)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:1001)
              at com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.initListeners(WabBundleProcessor.java:526)
              at com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.init(WabBundleProcessor.java:152)
              at com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer.doStart(WebBundleDeployer.java:82)
              at com.liferay.portal.osgi.web.wab.extender.internal.WabFactory$WABExtension.start(WabFactory.java:156)
              at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)
              at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)
              at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)
              at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:1)
              at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)
              at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:905)
              at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
              at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
              at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)
              at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)
              at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)
              at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)
              at org.eclipse.osgi.container.Module.publishEvent(Module.java:461)
              at org.eclipse.osgi.container.Module.start(Module.java:452)
              at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1252)
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1224)
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:313)
      Caused by: javax.faces.FacesException: com.liferay.faces.bridge.application.internal.ApplicationFactoryImpl
              at javax.faces.FactoryFinderInstance.getImplGivenPreviousImpl(FactoryFinderInstance.java:407)
              at javax.faces.FactoryFinderInstance.getImplementationInstance(FactoryFinderInstance.java:270)
              at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:543)
              at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:283)
              at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:328)
              ... 54 more
      Caused by: java.lang.InstantiationException: com.liferay.faces.bridge.application.internal.ApplicationFactoryImpl
              at java.lang.Class.newInstance(Class.java:427)
              at javax.faces.FactoryFinderInstance.getImplGivenPreviousImpl(FactoryFinderInstance.java:405)
              ... 58 more
      Caused by: java.lang.NoSuchMethodException: com.liferay.faces.bridge.application.internal.ApplicationFactoryImpl.<init>()
              at java.lang.Class.getConstructor0(Class.java:3082)
              at java.lang.Class.newInstance(Class.java:412)
              ... 59 more
      16:59:28,632 SEVERE [javax.faces] Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup.
      16:59:28,632 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
              at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:555)
              at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:283)
              at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:140)
              at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:343)
              at com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletContextListenerExceptionAdapter.contextDestroyed(ServletContextListenerExceptionAdapter.java:38)
              at org.eclipse.equinox.http.servlet.internal.registration.ListenerRegistration.destroy(ListenerRegistration.java:72)
              at org.eclipse.equinox.http.servlet.internal.customizer.ContextListenerTrackerCustomizer.removedService(ContextListenerTrackerCustomizer.java:100)
              at org.eclipse.equinox.http.servlet.internal.customizer.ContextListenerTrackerCustomizer.removedService(ContextListenerTrackerCustomizer.java:1)
              at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)
              at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1)
              at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
              at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:909)
              at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:917)
              at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
              at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:222)
              at com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.initListeners(WabBundleProcessor.java:534)
              at com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.init(WabBundleProcessor.java:152)
              at com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer.doStart(WebBundleDeployer.java:82)
              at com.liferay.portal.osgi.web.wab.extender.internal.WabFactory$WABExtension.start(WabFactory.java:156)
              at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)
              at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)
              at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)
              at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:1)
              at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)
              at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:905)
              at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
              at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
              at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)
              at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)
              at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)
              at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)
              at org.eclipse.osgi.container.Module.publishEvent(Module.java:461)
              at org.eclipse.osgi.container.Module.start(Module.java:452)
              at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1252)
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1224)
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:313)
      

      WORKAROUND

      To workaround this issue, you can add the following to your portal-ext.properties file:

      module.framework.properties.org.osgi.framework.bootdelegation=\
          __redirected,\
          com.sun.ccpp,\
          com.sun.ccpp.*,\
          com.sun.crypto.*,\
          com.sun.image.*,\
          com.sun.jmx.*,\
          com.sun.jna,\
          com.sun.jndi.*,\
          com.sun.mail.*,\
          com.sun.management.*,\
          com.sun.media.*,\
          com.sun.msv.*,\
          com.sun.org.*,\
          com.sun.syndication,\
          com.sun.tools.*,\
          com.sun.xml.*,\
          com.yourkit.*,\
          sun.*
      

      Attachments

        Issue Links

          Activity

            People

              shitian.zhang Shitian "Shelton" Zhang (Inactive)
              kyle.stiemann Kyle Stiemann (Inactive)
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                6 years, 28 weeks, 1 day ago

                Packages

                  Version Package
                  7.0.0 DXP FP2
                  7.0.0 DXP SP1
                  7.0.3 CE GA4
                  Master