Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-1296

NullPointerException thrown in ProductBaseImpl when running under JBoss AS

    Details

      Description

      This issue was first reported by Robson Miranda in FACES-1271 where he wrote:

      Seems that getClass().getPackage() in the product configuration classes (ProductLiferay*Impl) does not work in JBoss environment. The older approach works (ProductMap is lazy initialized), until we try to get one of the map's element.

      In JBoss, the exception below is thrown:
      at com.liferay.faces.bridge.context.ExternalContextFactoryImpl.<clinit>(ExternalContextFactoryImpl.java:38) [liferay-faces-bridge-impl-3.1.0-RC2-SNAPSHOT.jar:]
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_33]
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_33]
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_33]
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_33]
      at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:596) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:482) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at javax.faces.FactoryFinder.access$400(FactoryFinder.java:138) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:949) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:316) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_33]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_33]
      at java.lang.Thread.run(Thread.java:680) [:1.6.0_33]
      Caused by: java.lang.NullPointerException
      at com.liferay.faces.bridge.config.ProductBaseImpl.initVersionInfo(ProductBaseImpl.java:71) [liferay-faces-bridge-impl-3.1.0-RC2-SNAPSHOT.jar:]
      at com.liferay.faces.bridge.config.ProductBaseImpl.init(ProductBaseImpl.java:60) [liferay-faces-bridge-impl-3.1.0-RC2-SNAPSHOT.jar:]
      at com.liferay.faces.bridge.config.ProductLiferayFacesBridgeImpl.<init>(ProductLiferayFacesBridgeImpl.java:22) [liferay-faces-bridge-impl-3.1.0-RC2-SNAPSHOT.jar:]
      at com.liferay.faces.bridge.config.ProductMap.<clinit>(ProductMap.java:35) [liferay-faces-bridge-impl-3.1.0-RC2-SNAPSHOT.jar:]
      ... 22 more

      18:34:16,725 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/cd-loginuser-portlet]] (MSC service thread 1-6) Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: java.lang.ExceptionInInitializerError
      at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_33]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_33]
      at java.lang.Thread.run(Thread.java:680) [:1.6.0_33]
      Caused by: java.lang.ExceptionInInitializerError
      at com.liferay.faces.bridge.context.ExternalContextFactoryImpl.<clinit>(ExternalContextFactoryImpl.java:38) [liferay-faces-bridge-impl-3.1.0-RC2-SNAPSHOT.jar:]
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_33]
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_33]
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_33]
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_33]
      at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:596) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:482) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at javax.faces.FactoryFinder.access$400(FactoryFinder.java:138) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:949) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:316) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]
      at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      ... 8 more
      Caused by: java.lang.NullPointerException
      at com.liferay.faces.bridge.config.ProductBaseImpl.initVersionInfo(ProductBaseImpl.java:71) [liferay-faces-bridge-impl-3.1.0-RC2-SNAPSHOT.jar:]
      at com.liferay.faces.bridge.config.ProductBaseImpl.init(ProductBaseImpl.java:60) [liferay-faces-bridge-impl-3.1.0-RC2-SNAPSHOT.jar:]
      at com.liferay.faces.bridge.config.ProductLiferayFacesBridgeImpl.<init>(ProductLiferayFacesBridgeImpl.java:22) [liferay-faces-bridge-impl-3.1.0-RC2-SNAPSHOT.jar:]
      at com.liferay.faces.bridge.config.ProductMap.<clinit>(ProductMap.java:35) [liferay-faces-bridge-impl-3.1.0-RC2-SNAPSHOT.jar:]
      ... 22 more

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package
                  liferay-faces-3.0.0-legacy-ga1
                  liferay-faces-3.0.0-ga1
                  liferay-faces-3.1.0-ga1