This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 96181 - web.xml editor helps me chose an error page that causes an exception at runtime
Summary: web.xml editor helps me chose an error page that causes an exception at runtime
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: DD Editor (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: Trey Spiva
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-21 16:01 UTC by rdelaplante
Modified: 2016-07-07 08:56 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rdelaplante 2007-02-21 16:01:48 UTC
The visual web.xml editor helps me choose an error page of the .jsp files in my
visual web project.  I selected error.jsp.  In the deployment descriptor the
error page for specified error code points to /error.jsp.   When I run my
application and cause an error to occur, the error page throws an exception:

java.lang.IllegalStateException: No FacesContext is available to process this
request.  This is most likely due to the request being sent to the wrong path.
        at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:159)
        at org.apache.jsp.error_jsp._jspx_meth_f_view_0(error_jsp.java:136)
        at org.apache.jsp.error_jsp._jspService(error_jsp.java:113)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:353)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:412)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:318)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
        at
org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:850)
        at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:697)
        at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:534)
        at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:465)
        at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:353)
        at
org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:489)
        at
org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:378)
        at
org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:202)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:567)
        at
com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
        at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
        at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
        at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
        at
com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
        at
com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
        at
com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
org.apache.catalina.core.StandardHostValve@1a5022f: Exception Processing
ErrorPage[errorCode=404, location=/error.jsp]


Changing web.xml to point to /error.jsf solved my problem.  (I use *.jsf URL
pattern instead of /faces/*)
Comment 1 Marco Walther 2007-02-22 04:31:13 UTC
I believe you created your own problem when you changed just the mapping but 
not the error page??
Comment 2 rdelaplante 2007-02-22 13:42:07 UTC
I don't quite understand what you mean.  If you are referring to when I changed
/faces/* to /*.jsf mapping, this is before I had error pages.  After I confirmed
I could still use my web app, I then created a new VWP page called error.jsp. 
Next I used the visual web.xml editor to look at the error pages section.  There
were about 4 or 5 ones configured already for specific exceptions, and they were
not part of my project.  I removed all of them.  Next I clicked "add" (or
whatever the button says) and it displayed all of the .jsp files in my project.
 I selected error.jsp, and typed 400 for the error code.  Next I switched to XML
view and copy/pasted the newly created error page block many times editing just
the error code : 401, 402, 403, 404, 500, 501, 502, 503.  Save, build and deploy. 

From my experiences with VWP JSF projects, I find that if I try to access
/project/someJspFile.jsp, it always gives me the exception shown.  If I try to
access /project/faces/someJspFile.jsp (or in my case /project/someJspFile.jsf)
then it works.  I was thinking that the web.xml editor shouldn't be letting me
choose the .jsp file at the root of my project since it can't work?  
Comment 3 _ potingwu 2007-07-16 23:43:29 UTC
Currently only /ABC/* pattern works for error page but not for the pattern *.ABC.
Comment 4 Erno Mononen 2008-10-01 10:22:37 UTC
Agreed that it would nice. I think this is rather an enhancement however, so changing to a such. As for the 
implementation, the editor would somehow need to query the project what pages are acceptable error pages, and the 
project would need to know them of course.
Comment 5 Martin Balin 2016-07-07 08:56:07 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss