voyent
NullPointerException in ExtendedExceptionHandler.handle  XML
Forum Index -> Tools
Author Message
rowe

Joined: 13/Dec/2007 00:00:00
Messages: 12
Offline


Using Glassfish 3.1.2.2 and Icefaces 3.2, the attached minimal example project crashes with a NullPointerException in org.icefaces.impl.application.ExtendedExceptionHandler.handle(ExtendedExceptionHandler.java:80) on Mac OS 10.8.1.

Code:
 tar xzvf npe.tgz
 cd npe
 export DEPLOY_DIR=/Users/robert/glassfish3/glassfish/domains/domain1/autodeploy
 ant clean npe.war
 


then point your browser to http://127.0.0.1:8080/npe

Code:
 [#|2012-11-16T18:26:51.553-0600|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=17;_ThreadName=Thread-3;|StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
 java.lang.NullPointerException
         at org.icefaces.impl.application.ExtendedExceptionHandler.handle(ExtendedExceptionHandler.java:80)
         at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
         at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
         at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
         at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
         at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
         at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
         at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
         at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
         at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
         at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
         at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
         at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
         at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
         at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
         at java.lang.Thread.run(Thread.java:680)
 |#]
 


This is a new installation of Glassfish using default values.

What am I missing?

Robert
 Filename npe.tgz [Disk] Download
 Description Sample app showing the problem.
 Filesize 367 Kbytes
 Downloaded:  1408 time(s)

Admin

Joined: 27/May/2004 00:00:00
Messages: 219
Offline


Moved from General Help to Tools forum.

- Admin.
liming.wu

Joined: 26/Oct/2004 00:00:00
Messages: 441
Offline



1. mypage.jsp should be renamed to mypage.xhtml as it is xhtml file.
2. use h:head and h:body in mypage.xhtml
3. include icefaces-compat.jar and its dependent jars if you use ice component
4. http://127.0.0.1:8080/npe/mypage.jsp
[Email]
rowe

Joined: 13/Dec/2007 00:00:00
Messages: 12
Offline


Great, thanks, that worked.

However, I'd like to keep the jspx extension for my pages. This is an existing project and the files are named .jspx for historical reasons. I am afraid that SVN won't handle the big rename in the branch very well when merging.

Code:
     <servlet-mapping>
         <servlet-name>Faces Servlet</servlet-name>
         <url-pattern>*.jspx</url-pattern>
     </servlet-mapping>
 
     <context-param>
         <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
         <param-value>.jspx</param-value>
     </context-param>
 


I added this to web.xml but this gets me the NullPointerException again. It only works with the page renamed to .xhtml.

How can I keep the jspx extension?

Thanks,

Robert
liming.wu

Joined: 26/Oct/2004 00:00:00
Messages: 441
Offline


If you really want to use jspx extension for facelet xhtml page,
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.jspx</param-value>
</context-param>
is required.

Faces Servlet mapping can be any you like such as *.faces

Your request url should be http://xxxx:xxxx/yourapp/yourpage.faces

[Email]
Ophelia1402

Joined: 19/Jun/2018 09:58:23
Messages: 2
Offline


I have seen the HttpMonitor cause problems before so it might be worthwhile trying to turn that off when you are running from NetBeans. Looking at the source, it seems that it can't find a FacesContext instance which would suggest that the request is not in a JSF context. Probably going to need more information about when and how the error is occurring to provide better guidance.
 
Forum Index -> Tools
Go to:   
Powered by JForum 2.1.7ice © JForum Team