8 Replies Latest reply on Sep 13, 2012 11:29 AM by ndipiazza

    Jasper Exception when migrating from 4.0.5.CR1 to 4.2.0.CR1

    risenhoover

      Hi All,

      I have an existing web application that is currently operational under 4.0.5.CR1. The login page (login.jsp) is a very simple struts page that does exactly what you think it does.

      I am attempting to migrate to 4.2.0, but when I install my new web application, I get a JasperException when I attempt to load this page. This is the output in the log:

      2007-03-09 17:17:23,786 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/DAXAppWeb].[jsp]] Servlet.service() for servlet jsp threw except
      ion
      org.apache.jasper.JasperException: Unable to compile class for JSP:


      Stacktrace:
      at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
      at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
      at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      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:228)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:87)
      at org.jboss.web.tomcat.service.session.JvmRouteValve.invoke(JvmRouteValve.java:84)
      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:216)
      at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
      at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:447)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
      at java.lang.Thread.run(Thread.java:619)

      Does anybody have any thoughts on what might be causing this, or how I might increase the granularity of the logging to find out what the compile-time error is?

      Thanks.

        • 1. Re: Jasper Exception when migrating from 4.0.5.CR1 to 4.2.0.
          rmaucher

          There a minor regression where the error is not displayed when it occurs in a place which does not correspond to a location in the JSP source. You should be looking at the generated code.

          • 2. Re: Jasper Exception when migrating from 4.0.5.CR1 to 4.2.0.
            risenhoover


            So what does this mean to me? I've got a JSP file in a WAR that works fine in 4.0.5 and gets a JasperException when deployed in 4.2.0. Are you saying that because there is no listing in the stack trace, that the error is not in the JSP?

            There's almost nothing in the page except for some references to struts: (e.g)

            <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
            <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

            Could it be these?

            Paul

            • 3. Re: Jasper Exception when migrating from 4.0.5.CR1 to 4.2.0.
              risenhoover

              FIXED!

              My web application had jsp-2.0.jar in the WEB-INF/lib directory. It was apparently conflicting with the jsp.jar file in the jboss lib directory. I removed it and it works!

              • 4. Re: Jasper Exception when migrating from 4.0.5.CR1 to 4.2.0.
                rmaucher

                Glad you fixed the issue.

                What I meant is that it happens if there is an error compiling the generated source and it does not map to your JSP code (for example, it could happen if Jasper generated some syntax error at the beginning of the source). In that rare case, you'll run into a bug where the error message is not displayed (which is obviously unfortunate).

                • 5. Re: Jasper Exception when migrating from 4.0.5.CR1 to 4.2.0.
                  vetalok

                  I have different behaviour too.
                  With jboss-4.0.3SP1 my jsp has compiled and works well but with jboss-4.2.0GA jboss can't compile my jsp, it says:
                  11:52:21,284 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
                  org.apache.jasper.JasperException: Unable to compile class for JSP:

                  An error occurred at line: 22 in the generated java file
                  The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

                  Stacktrace:
                  at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
                  at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
                  at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
                  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
                  =============
                  What does it mean?
                  I have not any js*.jar in my ear file.
                  Any ideas?

                  • 6. Re: Jasper Exception when migrating from 4.0.5.CR1 to 4.2.0.
                    santhosh288

                    Hi vetalok,

                    Have you managed to Fix this error in JBOSS 4.2.0? I am also getting the same exception

                    org.apache.jasper.JasperException: Unable to compile class for JSP:

                    An error occurred at line: 32 in the generated java file
                    The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory


                    Thanks,
                    Santhosh

                    • 7. Re: Jasper Exception when migrating from 4.0.5.CR1 to 4.2.0.
                      openyourmind

                      Hi all, I had the same problem and solved it by supressing "javax.servlet.jsp.jar" from my war classpath. As stated before, I guess some conflict between jars was taking place. Bye. OYM

                      • 8. Re: Jasper Exception when migrating from 4.0.5.CR1 to 4.2.0.CR1
                        ndipiazza

                        Yep same problem in a JBoss4.3.0.GA EAP application running from MyEclipse8. I do not have a javax.servlet.jsp.jar in my project, but when I went to the deployment location that is created by the MyEclipse + Server deployment... I found a javax.servlet.jsp.jar

                         

                        I went into the deploy location and manually deleted this file. now it is happy boy.