0

I have a JSF project developped in Eclipse and I've recently moved from Tomcat 8 + Mojarra JSF-2.2 using Managed beans/properties to a Tomee 7 + MyFaces-2 using CDI environment to be able to add Omnifaces into the project. After many hours everything seems to be working except sessions reloading. I'm getting the following exception when saving a change in the code which initiates the reload (it was working properly with Tomcat 8):

SEVERE org.apache.catalina.session.StandardManager startInternal: Exception loading sessions from persistent storage
java.lang.NullPointerException
at org.apache.webbeans.proxy.NormalScopeProxyFactory.createNormalScopeProxy(NormalScopeProxyFactory.java:121)
at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.readResolve(NormalScopedBeanInterceptorHandler.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1104)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1810)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at java.util.HashMap.readObject(HashMap.java:1396)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at org.apache.webbeans.context.PassivatingContext.readExternal(PassivatingContext.java:54)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1840)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1799)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at org.apache.catalina.session.StandardSession.doReadObject(StandardSession.java:1627)
at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1090)
at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:261)
at org.apache.catalina.session.StandardManager.load(StandardManager.java:180)
at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:460)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5253)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3812)
at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:292)
at org.apache.tomee.catalina.TomEEWebappLoader.backgroundProcess(TomEEWebappLoader.java:59)
at org.apache.tomee.catalina.LazyStopLoader.backgroundProcess(LazyStopLoader.java:105)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5597)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1377)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1349)
at java.lang.Thread.run(Thread.java:745)

I found some similar problems with loading the sessions but these were always different exceptions (some IO or Class Not Found exceptions).

Does any of you have an idea what's wrong with the server or project?


Used libraries:

  • BootsFaces-OSP-0.8.1-dist-default.jar
  • botdetect-3.0.alpha3.jar
  • javax.servlet.jsp.jstl-1.2.1.jar
  • javax.servlet.jsp.jstl-api-1.2.1.jar
  • omnifaces-2.2.jar primefaces-5.3.jar

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">

<display-name>Name</display-name>

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet>
    <servlet-name>BotDetect Captcha</servlet-name>
    <servlet-class>botdetect.web.http.CaptchaServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>BotDetect Captcha</servlet-name>
    <url-pattern>/botdetectcaptcha</url-pattern>
</servlet-mapping>

<context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
</context-param>
<context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>resources.application</param-value>
</context-param>
<context-param>
    <param-name>LBD_soundEnabled</param-name>
    <param-value>false</param-value>
</context-param>
<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>

<welcome-file-list>
    <welcome-file>index.jsf</welcome-file>
</welcome-file-list>
</web-app>
MWiesner
  • 8,868
  • 11
  • 36
  • 70
Rada
  • 52
  • 5
  • I've created an empty project using the final configuration and started adding component after component... and I've soon found out that the problem is most probably in the Bootsfaces library... I'll check it further. – Rada Feb 14 '16 at 15:31
  • A NullPointerException is hard to trace. We (the BootsFaces team) will try, nonetheless. Would you mind to upload the empty demo project and give us a step-by-step explanation on how to reproduce the error? Thanks in advance! – Stephan Rauh Feb 14 '16 at 21:46
  • Also see the bug opened on the BootsFaces bug tracker (https://github.com/TheCoder4eu/BootsFaces/issues/44). – Stephan Rauh Feb 14 '16 at 21:51
  • Are you referring to the hot code replacing when you say "I'm getting the following exception when saving a change in the code which initiates the reload"? – Stephan Rauh Feb 14 '16 at 21:53
  • A bug report created in the proper GitHub project: https://github.com/TheCoder4eu/BootsFaces-OSP/issues/293 – Rada Feb 16 '16 at 21:43

0 Answers0