Foren

NPE with 4.2.0-m2 during Initialization

thumbnail
Tobias Liefke, geändert vor 9 Jahren.

NPE with 4.2.0-m2 during Initialization

Junior Member Beiträge: 78 Beitrittsdatum: 23.11.12 Neueste Beiträge
I'm just upgrading to Wildfly 8.1.0 + liferay-faces 4.2.0-m2 (snapshot) and receiving a NPE during startup:

java.lang.NullPointerException
	at com.liferay.faces.util.config.ApplicationConfigInitializerImpl.newResourceReader(ApplicationConfigInitializerImpl.java:90)
	at com.liferay.faces.util.config.ApplicationConfigInitializerImpl.initialize(ApplicationConfigInitializerImpl.java:48)
	at com.liferay.faces.util.config.ApplicationConfigUtil.initializeApplicationConfig(ApplicationConfigUtil.java:38)
	at com.liferay.faces.bridge.BridgeImpl.init(BridgeImpl.java:168)
	at javax.portlet.faces.GenericFacesPortlet.init(GenericFacesPortlet.java:92)
	at com.liferay.portlet.InvokerPortletImpl.init(InvokerPortletImpl.java:269)
	at com.liferay.portlet.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:228)
	at com.liferay.portlet.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:145)
	at com.liferay.portlet.PortletInstanceFactoryUtil.create(PortletInstanceFactoryUtil.java:41)
	at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:337)
	at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:369)
	at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:124)
	at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:208)
	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:164)
	at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:154)
	at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:44)
	at com.liferay.portal.kernel.util.PortalLifecycleUtil.flushInits(PortalLifecycleUtil.java:48)
	at com.liferay.portal.servlet.MainServlet.initPlugins(MainServlet.java:826)
	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:347)
,,,


I'm sure that I miss something in the configuration...
(it is trying to access the FacesContext at the given point, which from my point of view isn't available during initialization of the MainServlet)
thumbnail
Neil Griffin, geändert vor 9 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
Hi Tobias,

The 4.2.0-SNAPSHOT version of Liferay Faces was fairly old and out of date. I just refreshed the snapshot. When you get a chance, please try the latest snapshot and let me know if you still see the same problem.

Thanks,

Neil
thumbnail
Neil Griffin, geändert vor 9 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
Forgot to mention, here is a link to the snapshot repository.
thumbnail
Fahad v, geändert vor 9 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Junior Member Beiträge: 35 Beitrittsdatum: 14.07.14 Neueste Beiträge
We are getting the same error during the liferay startup with 4.2.0-m2


09:35:17,897 INFO [BridgeImpl] Initializing Liferay Faces Bridge 4.2.0-m2 (Philippi / Oct 1, 2014 AD)
09:35:18,008 ERROR [Thread-33][PortletBagFactory:340] java.lang.NullPointerException
java.lang.NullPointerException
at com.liferay.faces.util.config.ApplicationConfigInitializerImpl.newResourceReader(ApplicationConfigInitializerImpl.java:90)
at com.liferay.faces.util.config.ApplicationConfigInitializerImpl.initialize(ApplicationConfigInitializerImpl.java:48)
at com.liferay.faces.util.config.ApplicationConfigUtil.initializeApplicationConfig(ApplicationConfigUtil.java:38)
at com.liferay.faces.bridge.BridgeImpl.init(BridgeImpl.java:168)
at javax.portlet.faces.GenericFacesPortlet.init(GenericFacesPortlet.java:92)
at com.liferay.portlet.InvokerPortletImpl.init(InvokerPortletImpl.java:269)
at com.liferay.portlet.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:228)
at com.liferay.portlet.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:145)
at sun.reflect.GeneratedMethodAccessor106.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.security.lang.DoPrivilegedHandler$InvokePrivilegedExceptionAction.run(DoPrivilegedHandler.java:167)
at java.security.AccessController.doPrivileged(Native Method)
at com.liferay.portal.security.lang.DoPrivilegedHandler.doInvoke(DoPrivilegedHandler.java:100)
at com.liferay.portal.security.lang.DoPrivilegedHandler.invoke(DoPrivilegedHandler.java:56)
at $Proxy602.create(Unknown Source)
at com.liferay.portlet.PortletInstanceFactoryUtil.create(PortletInstanceFactoryUtil.java:41)
at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:337)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:369)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:124)
at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:208)
at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.security.lang.DoPrivilegedHandler$InvokePrivilegedExceptionAction.run(DoPrivilegedHandler.java:167)
at java.security.AccessController.doPrivileged(Native Method)
at com.liferay.portal.security.lang.DoPrivilegedHandler.doInvoke(DoPrivilegedHandler.java:100)
at com.liferay.portal.security.lang.DoPrivilegedHandler.invoke(DoPrivilegedHandler.java:56)
at $Proxy26.fireDeployEvent(Unknown Source)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:164)
at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:154)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:44)
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:54)
at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:116)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
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:662)
thumbnail
Fahad v, geändert vor 9 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Junior Member Beiträge: 35 Beitrittsdatum: 14.07.14 Neueste Beiträge
hi,

it worked for me when i downgraded the jsf and bridge
now my configration is jsf 2.1 bridge 3.2 and primefaces 5.1

this portltet was deployed correctly

so is it issue with liferay faces bridge 4.2 m2 ?
or my liferay version ?
please comment emoticon
thumbnail
Kyle Joseph Stiemann, geändert vor 9 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Liferay Master Beiträge: 760 Beitrittsdatum: 14.01.13 Neueste Beiträge
Hi Fahad,
Initially you were using Liferay Faces 4.2 which is incompatible with JSF 2.1 (it is compatible with JSF 2.2). Liferay Faces 3.2, however, is designed to be used with JSF 2.1, so that is the version of the Bridge which you should be using. See the Liferay Faces version scheme for more details.

- Kyle
thumbnail
Kyle Joseph Stiemann, geändert vor 9 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Liferay Master Beiträge: 760 Beitrittsdatum: 14.01.13 Neueste Beiträge
Out of curiosity, were you trying to use 4.2.0-m2 for our new component library?

- Kyle
thumbnail
Fahad v, geändert vor 9 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Junior Member Beiträge: 35 Beitrittsdatum: 14.07.14 Neueste Beiträge
HI Kyle,

I first tried with the combination Bridge 4.2.m2 JSF 2.2 LIFERAY 6.2
and got the error that is shown in previous post.

so for checking i downgraded to Bridge 3.2. JSF2.1 LIFERAY 6.2
Then all worked fine.

i don't understand why ?emoticon
thumbnail
Juan Gonzalez, geändert vor 9 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Hi Fahad,

probably you were using a JSF 2.1 application server. Can you confirm this hypothesis?
thumbnail
Fahad v, geändert vor 9 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Junior Member Beiträge: 35 Beitrittsdatum: 14.07.14 Neueste Beiträge
we are using tomcat that comes with liferay 6.2
thumbnail
Juan Gonzalez, geändert vor 9 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Fahad v:
we are using tomcat that comes with liferay 6.2


Maybe there is some jsf implementation library duplicated somewhere in your tomcat server classpath or within your application. Be sure to include JSF libraries only once.
Patrick Ehmke, geändert vor 8 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

New Member Beiträge: 2 Beitrittsdatum: 29.04.15 Neueste Beiträge
Dear Liferay Team,

i am currently trying to use the liferay faces bridge 4.2.0-m2 on a WebSphere Portalserver 8.5 with the latest Mojarra JSF Release 2.2.10.
During the initialization process i'm running into the same problem.

Are there any news/updates regarding this problem or is the WebSphere Portalserver 8.5 not supported?

Kind regards
Patrick Ehmke
thumbnail
Kyle Joseph Stiemann, geändert vor 8 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Liferay Master Beiträge: 760 Beitrittsdatum: 14.01.13 Neueste Beiträge
Hi Patrick,
Liferay Faces 4.2 only works with tomcat. The reasons for this are outlined in Neil's announcement blog.

- Kyle
thumbnail
Kyle Joseph Stiemann, geändert vor 8 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Liferay Master Beiträge: 760 Beitrittsdatum: 14.01.13 Neueste Beiträge
Alternatively, you can try 3.2.4-ga5-SNAPSHOT jars with JSF 2.1 if you want to try our newest components in WebSphere.

Note: you will need to follow these instructions to use Liferay Faces in WebSphere.

- Kyle
Patrick Ehmke, geändert vor 8 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

New Member Beiträge: 2 Beitrittsdatum: 29.04.15 Neueste Beiträge
Hi Kyle,

thank you for the fast response.
I already tried the 3.2.4 bridge which is working great with WebSphere.
However i was curious if the 4.2 version would work as well.

Is it planned to support the WebSphere Portalserver in future releases?
thumbnail
Kyle Joseph Stiemann, geändert vor 8 Jahren.

RE: NPE with 4.2.0-m2 during Initialization

Liferay Master Beiträge: 760 Beitrittsdatum: 14.01.13 Neueste Beiträge
Liferay Faces 4.2 is designed for compatibility with JSF 2.2 (which is part of Java EE 7). Since Websphere Application Server is Java EE 6, it does not support Java EE 7 features such as JSF 2.2. So Liferay Faces 4.2 does not support Websphere. However, the main difference between 3.2 and 4.2 is JSF 2.2 support, so when 3.2.5-ga6 and 4.2.5-ga6 are released, they will have mostly the same features (including new Alloy and Portal components emoticon ).

- Kyle