| Author |
Error of cannot find FacesContext
|
Robert Strong
Ranch Hand
Joined: Sep 10, 2002
Posts: 84
|
|
hi, I'm using JavaServerFace on Weblogic8.1 SP3, the web application seems to be deployed successfully. But everytime when I request a JSP with JSF component, it'd throw such error: javax.servlet.jsp.JspException: Cannot find FacesContext at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:399) at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105) at jsp_servlet.__propertysearch._jspService(__propertysearch.java:168) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178) any help appreciated!!
|
 |
Sergey Smirnov
Ranch Hand
Joined: May 29, 2003
Posts: 167
|
|
Most likely, it happens if you call jsp directly without using the servlet mapping. There is a number of other issues you can check including the servlet specific ones. See also: http://forums.bea.com/bea/message.jspa?messageID=202173921&tstart=0 -- Sergey : jsfTutorials.net
|
 |
Varun Khanna
Ranch Hand
Joined: May 30, 2002
Posts: 1400
|
|
Seems you are not going through FacesServlet. See this thread if it can solve your problem.
|
- Varun
|
 |
Ryan Chiu
Greenhorn
Joined: Jun 21, 2005
Posts: 5
|
|
Hi, I have this problem in Tomcat 5.0.28, but I found something may be that will help you. In my web.xml, I had defined this before ... <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> ...... <welcome-file-list> <welcome-file>faces/hello.jsp</welcome-file> </welcome-file-list> I can see something when I use http://localhost:8080/faces,but had problem to view like http://localhost:8080/MyTest.jsp, so I changed MyTest.jsp to MyTest.jsf, then everything run well. I found in my c:\tomcat\conf\web.xml has this: <!-- The mapping for the JSP servlet --> <servlet-mapping> <servlet-name>jsp</servlet-name> <url-pattern>*.jsp</url-pattern> </servlet-mapping> so I guess when you run http:/xxx/*.jsp, it will forward to org.apache.jasper.servlet.JspServlet not javax.faces.webapp.FacesServlet, so it throws "could not found FacesContext excetion".I thing that it the same in WL 8.0, maybe you can try it.
|
 |
 |
|
|
subject: Error of cannot find FacesContext
|
|
|