[Tomcat, HTTPD, Servlets & JSP] - Null Pointer in JSP compile
by nodari
Hi,
I have a web application deployed in JBoss 4.2.1 GA and when I try to access the JSP pages I get the following error:
Exception
org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:574)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
Root cause
java.lang.NullPointerException
java.io.Writer.write(Writer.java:126)
java.io.PrintWriter.newLine(PrintWriter.java:408)
java.io.PrintWriter.println(PrintWriter.java:559)
java.io.PrintWriter.println(PrintWriter.java:670)
org.apache.jasper.compiler.ServletWriter.printil(ServletWriter.java:130)
org.apache.jasper.compiler.Generator.genPreamblePackage(Generator.java:454)
org.apache.jasper.compiler.Generator.generatePreamble(Generator.java:557)
org.apache.jasper.compiler.Generator.generate(Generator.java:3371)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:210)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
Someone can help me with this ?
Thanks in advance,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104742#4104742
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104742
18 years, 8 months
[JBoss Seam] - No phase id bound to current thread exception
by tresspicher
Hi all,
I am a newcomer to JEE and SEAM, so bear with me. I have searched the forums and have not been able to find a solution that resolves this issue for me. I am using SEAM 2.0.0 BETA 1 + Facelets + RichFaces 3.2.1. I had been using ajax4jsf but replaced it with RichFaces and that's when I started getting the problem. If anything obvious jumps out at you, please let me know:
The exception occurs when I navigate to a different page. Stack trace:
| 11:29:09,879 ERROR [ResourceLifecycle] Exception in PhaseListener, phase :RESTORE_VIEW 1 : afterPhase
| java.lang.IllegalStateException: No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed)
| at org.jboss.seam.contexts.PageContext.getPhaseId(PageContext.java:153)
| at org.jboss.seam.contexts.PageContext.isRenderResponsePhase(PageContext.java:165)
| at org.jboss.seam.contexts.PageContext.getCurrentReadableMap(PageContext.java:76)
| at org.jboss.seam.contexts.PageContext.get(PageContext.java:66)
| at org.jboss.seam.contexts.Contexts.lookupInStatefulContexts(Contexts.java:160)
| at org.jboss.seam.Component.getInstance(Component.java:1577)
| at org.jboss.seam.Component.getInstance(Component.java:1572)
| at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
| at com.sun.faces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:72)
| at org.ajax4jsf.context.AjaxContext.getCurrentInstance(AjaxContext.java:101)
| at org.ajax4jsf.event.AjaxPhaseListener.afterPhase(AjaxPhaseListener.java:75)
| at org.ajax4jsf.resource.ResourceLifecycle.invokePhaseListener(ResourceLifecycle.java:203)
| at org.ajax4jsf.resource.ResourceLifecycle.processPhaseListeners(ResourceLifecycle.java:184)
| at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:141)
| at org.ajax4jsf.resource.InternetResourceService.load(InternetResourceService.java:336)
| at org.ajax4jsf.cache.LRUMapCache.load(LRUMapCache.java:116)
| at org.ajax4jsf.cache.LRUMapCache.get(LRUMapCache.java:87)
| at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:198)
| at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:144)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:265)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
|
web.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <web-app version="2.5"
| xmlns="http://java.sun.com/xml/ns/javaee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
| <context-param>
| <param-name>org.richfaces.SKIN</param-name>
| <param-value>blueSky</param-value>
| </context-param>
| <filter>
| <display-name>RichFaces Filter</display-name>
| <filter-name>richfaces</filter-name>
| <filter-class>org.ajax4jsf.Filter</filter-class>
| </filter>
| <filter-mapping>
| <filter-name>richfaces</filter-name>
| <servlet-name>Faces Servlet</servlet-name>
| <dispatcher>REQUEST</dispatcher>
| <dispatcher>FORWARD</dispatcher>
| <dispatcher>INCLUDE</dispatcher>
| </filter-mapping>
| <context-param>
| <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
| <param-value>
| org.jboss.seam.ui.facelet.SeamFaceletViewHandler
| </param-value>
| </context-param>
|
| <!-- Seam -->
| <listener>
| <listener-class>
| org.jboss.seam.servlet.SeamListener
| </listener-class>
| </listener>
|
| <filter>
| <filter-name>Seam Filter</filter-name>
| <filter-class>
| org.jboss.seam.web.SeamFilter
| </filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Seam Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
| <servlet>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <url-pattern>/seam/resource/*</url-pattern>
| </servlet-mapping>
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <context-param>
| <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| <param-value>.html</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.seam</url-pattern>
| </servlet-mapping>
|
| <listener>
| <listener-class>
| com.sun.faces.config.ConfigureListener
| </listener-class>
| </listener>
|
faces-config.xml:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <faces-config version="1.2"
| xmlns="http://java.sun.com/xml/ns/javaee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesfonfig_1_2.xsd">
|
| <application>
| <el-resolver>org.jboss.seam.jsf.SeamELResolver</el-resolver>
| </application>
|
| <lifecycle>
| <phase-listener>
| org.jboss.seam.jsf.SeamPhaseListener
| </phase-listener>
| </lifecycle>
| </faces-config>
|
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104738#4104738
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104738
18 years, 8 months
[JBoss Seam] - Re: Difference between session timeout and not logged in yet
by jacob.orshalick
You have to make some assumptions here, but you can basically notify the user when the server session has ended with the following in a PhaseListener:
@Observer("org.jboss.seam.beforePhase")
| public void beforePhase(PhaseEvent event)
| {
| if(event.getPhaseId() == PhaseId.RESTORE_VIEW)
| {
| HttpServletRequest request =
| (HttpServletRequest) FacesContext.getCurrentInstance()
| .getExternalContext().getRequest();
|
| if(request.getRequestedSessionId() != null
| && request.getSession().isNew())
| Events.instance().raiseEvent("org.myOrg.sessionExpired");
| ...
Based on general cookie settings this will raise the event when the user still has the browser window open, the http session expired, and the user tries to access the app. If the user closes and reopens the browser to start the application, the event will not be raised.
This of course makes the assumption that cookies expire when the browser session is ended (which is generally the case). Good luck.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104732#4104732
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104732
18 years, 8 months