Skip to main content

Getting NullPointerException using jsf-extensions with JSF 1.2

1 reply [Last post]
sunilramaiah
Offline
Joined: 2006-05-05
Points: 0

Hi,

I am using jsf-extensions with JSF 1.2 and deploying it in Tomcat 6. I have a simple JSF page where in I have to selectOneListBoxes and I have setup the jsf-extensions. On selecting an item in one selectOneListBox, the other selectOneListBox gets updated. Problem is this happens only once. For the next request, I get the exception below.

Can anyone please let me know what could be the problem ?

java.util.logging.ErrorManager: 5 java.lang.NullPointerException at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:103)
at java.util.ResourceBundle.getObject(ResourceBundle.java:319)
at java.util.ResourceBundle.getString(ResourceBundle.java:285)
at java.util.logging.Formatter.formatMessage(Formatter.java:108)
at java.util.logging.SimpleFormatter.format(SimpleFormatter.java:63)
at org.apache.juli.FileHandler.publish(FileHandler.java:129)
at java.util.logging.Logger.log(Logger.java:452)
at java.util.logging.Logger.doLog(Logger.java:474)
at java.util.logging.Logger.log(Logger.java:563)
at com.sun.faces.renderkit.ResponseStateManagerImpl.getTreeStructureToRestore(ResponseStateManagerImpl.java:197)
at javax.faces.render.ResponseStateManager.getState(ResponseStateManager.java:218)
at com.sun.faces.renderkit.ResponseStateManagerImpl.getState(ResponseStateManagerImpl.java:137)
at com.sun.faces.application.StateManagerImpl.restoreTreeStructure(StateManagerImpl.java:658)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:229)
at javax.faces.application.StateManagerWrapper.restoreView(StateManagerWrapper.java:167)
at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:300)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:174)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:132)
at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:94)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
java.util.logging.ErrorManager: 5
java.lang.NullPointerException
at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:103)
at java.util.ResourceBundle.getObject(ResourceBundle.java:319)
at java.util.ResourceBundle.getString(ResourceBundle.java:285)
at java.util.logging.Formatter.formatMessage(Formatter.java:108)
at java.util.logging.SimpleFormatter.format(SimpleFormatter.java:63)
at java.util.logging.StreamHandler.publish(StreamHandler.java:179)
at java.util.logging.ConsoleHandler.publish(ConsoleHandler.java:88)
at java.util.logging.Logger.log(Logger.java:452)
at java.util.logging.Logger.doLog(Logger.java:474)
at java.util.logging.Logger.log(Logger.java:563)
at com.sun.faces.renderkit.ResponseStateManagerImpl.getTreeStructureToRestore(ResponseStateManagerImpl.java:197)
at javax.faces.render.ResponseStateManager.getState(ResponseStateManager.java:218)
at com.sun.faces.renderkit.ResponseStateManagerImpl.getState(ResponseStateManagerImpl.java:137)
at com.sun.faces.application.StateManagerImpl.restoreTreeStructure(StateManagerImpl.java:658)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:229)
at javax.faces.application.StateManagerWrapper.restoreView(StateManagerWrapper.java:167)
at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:300)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:174)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:132)
at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:94)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Jan 25, 2008 11:20:31 PM com.sun.faces.lifecycle.LifecycleImpl phase
WARNING: executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@1fe1e26) threw exception
javax.faces.FacesException: java.io.EOFException
at com.sun.faces.renderkit.ResponseStateManagerImpl.getTreeStructureToRestore(ResponseStateManagerImpl.java:198)
at javax.faces.render.ResponseStateManager.getState(ResponseStateManager.java:218)
at com.sun.faces.renderkit.ResponseStateManagerImpl.getState(ResponseStateManagerImpl.java:137)
at com.sun.faces.application.StateManagerImpl.restoreTreeStructure(StateManagerImpl.java:658)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:229)
at javax.faces.application.StateManagerWrapper.restoreView(StateManagerWrapper.java:167)
at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:300)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:174)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:132)
at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:94)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.EOFException
at java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:202)
at java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:192)
at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:131)
at java.util.zip.GZIPInputStream.(GZIPInputStream.java:58)
at java.util.zip.GZIPInputStream.(GZIPInputStream.java:68)
at com.sun.faces.renderkit.ResponseStateManagerImpl.getTreeStructureToRestore(ResponseStateManagerImpl.java:173)
... 23 more
Jan 25, 2008 11:20:31 PM com.sun.faces.lifecycle.LifecycleImpl phase
WARNING: phase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@1fe1e26) threw exception: java.lang.NullPointerException null
org.apache.shale.remoting.impl.MappingImpl.viewId(MappingImpl.java:296)
org.apache.shale.remoting.impl.MappingImpl.mapViewId(MappingImpl.java:228)
org.apache.shale.remoting.faces.RemotingPhaseListener.afterPhase(RemotingPhaseListener.java:116)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:287)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:132)
com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:94)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:595)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sunilramaiah
Offline
Joined: 2006-05-05
Points: 0

I had set the STATE_SAVING_METHOD to client in the previous thread.

I changed it to server and now I get the following exception -

This is my web.xml

-

com.sun.faces.verifyObjects false

com.sun.faces.validateXml false

javax.faces.STATE_SAVING_METHOD server


Faces
javax.faces.webapp.FacesServlet

javax.faces.LIFECYCLE_ID com.sun.faces.lifecycle.PARTIAL
1


Faces
*.faces


Faces
/faces/*


Faces
*.jsf


30


index.html
index.htm
index.jsp

There are the jars in my WEB-INF/lib -

activation-1.1.jar
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-discovery-0.4.jar
commons-lang-2.1.jar
commons-logging-1.1.jar
jsf-api.jar
jsf-impl.jar
jstl-1.1.0.jar
mail-1.4.jar
standard.jar
jsf-extensions-common-0.1.jar
jsf-extensions-dynamic-faces-0.1.jar
jsf-extensions-flash-0.1.jar
jsf-extensions-test-time-0.1.jar
shale-remoting-1.1.0-swdp-b.jar
antlr.jar
asm.jar
cglib.jar
dom4j.jar
hibernate.jar
javaee.jar
mysql-connector-java-3.0.9-stable-bin.jar

As I mentioned in my previous post, the AJAX call goes through fine for the first time and tthen for the rest of the calls, I get these exceptions.

Jan 26, 2008 12:16:04 AM com.sun.faces.lifecycle.LifecycleImpl phase
WARNING: executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@1df3082) threw exception
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1768)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:273)
at javax.faces.application.StateManagerWrapper.restoreView(StateManagerWrapper.java:167)
at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:300)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:174)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:132)
at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:94)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Jan 26, 2008 12:16:04 AM com.sun.faces.lifecycle.LifecycleImpl phase
WARNING: phase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@1df3082) threw exception: java.lang.NullPointerException null
org.apache.shale.remoting.impl.MappingImpl.viewId(MappingImpl.java:296)
org.apache.shale.remoting.impl.MappingImpl.mapViewId(MappingImpl.java:228)
org.apache.shale.remoting.faces.RemotingPhaseListener.afterPhase(RemotingPhaseListener.java:116)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:287)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:132)
com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:94)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:595)