0 Replies Latest reply on Jan 22, 2009 4:33 PM by Ashish SHUKLA

    Error occured during JSP compilation in JBoss 5.0

    Ashish SHUKLA Newbie

      Hi all,

      I've posted this message to 'jboss-user' list too.

      While trying to view a jsp page I've deployed in a WAR (inside an EAR), I'm
      getting following error:

      01:55:08,585 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      org.apache.jasper.JasperException: Unable to compile class for JSP:
      
      An error occurred at line: 30 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:423)
       at org.apache.jasper.compiler.Compiler.compile(Compiler.java:335)
       at org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)
       at org.apache.jasper.compiler.Compiler.compile(Compiler.java:300)
       at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
       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:235)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
       at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
       at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:636)


      Following is an excerpt from the generated java code (with line numbers):

      28 public void _jspInit() {
      29 _005fjspx_005ftagPool_005fc_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
      30 _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
      31 _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
      32 }


      From the Google search, I've concluded that this could be due to the
      classloading issues. So I checked my EAR, to see if there is any system-provided
      jar is deployed, but I found none. Then I started the JBoss with java's
      -verbose:class switch, and found the javax.servlet.jsp.JspFactory is loaded from
      the "jsp-api.jar" file shipped with JBoss.

      % ./run.sh |fgrep JspFactory
      [Loaded javax.servlet.jsp.JspFactory from jar:file:/home/dev/jboss-5.0.0.GA/common/lib/jsp-api.jar!/]
      [Loaded org.apache.jasper.runtime.JspFactoryImpl from jar:file:/home/dev/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jbossweb.jar!/]
      [Loaded org.apache.jasper.runtime.JspFactoryImpl$1 from jar:file:/home/dev/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jbossweb.jar!/]
      The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory


      Any ideas how to troubleshoot this issue ?

      Thanks in advance