java.lang.NoSuchMethodError while starting PSI Probe

694 views
Skip to first unread message

Meik Behnfeldt

unread,
Sep 7, 2011, 4:26:41 AM9/7/11
to psi-probe-discuss
Hello,

I was able to deploy the probe.war (version 2.2.3) to my tomcat server
(Red Hat Linux 4.1.2-48, Tomcat 6.0.24, JDK 1.6.0.23).

When I start PSI Probe, I get the following stacktrace:

java.lang.NoSuchMethodError:
javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/
ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;

org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:
910)

jsp.WEB_002dINF.jsp.applications_jsp._jspService(jsp.WEB_002dINF.jsp.applications_jsp:
141)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:
39)

org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:
236)

org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:
257)

org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:
1183)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:
902)
com.googlecode.psiprobe.ProbeServlet.doDispatch(ProbeServlet.java:53)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:
807)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:
571)

org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:
501)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:
39)

org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:
706)

org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:
677)
jsp.index_jsp._jspService(jsp.index_jsp:43)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:
118)

com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:
52)

Does anybody have an idea how to fix this?

Thanks in advance!

Regards

Meik Behnfeldt

Mark

unread,
Sep 10, 2011, 1:23:30 PM9/10/11
to psi-prob...@googlegroups.com
It could be a problem with the pre-compiled JSPs that are included in the probe.war.  They are safe to delete, so try this:
  1. Open up probe.war in your favorite ZIP program.
  2. Dig down into WEB-INF/classes and delete the jsp directory.
  3. Redeploy the modified probe.war file.
Let me know how it works out.  These files will be excluded from probe.war in the next release.

Mark

unread,
Sep 10, 2011, 1:25:03 PM9/10/11
to psi-prob...@googlegroups.com
Sorry, I forgot one step.  After deleting the jsp directory, you also need to edit web.xml and delete lines 66 to 842.

Meik Behnfeldt

unread,
Sep 15, 2011, 9:31:37 AM9/15/11
to psi-probe-discuss
Hello Mark,

thanks for your answer.

I just followed the steps you described and the
java.lang.NoSuchMethodError disappeared, but know I get the following
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:

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:
92)

org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:
330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:
439)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:
589)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:
118)

com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:
52)

--

Regards

Meik Behnfeldt

Mark

unread,
Sep 15, 2011, 11:25:48 AM9/15/11
to psi-prob...@googlegroups.com
Can I send you a snapshot build to try?  Please email me.

Mark

unread,
Sep 16, 2011, 1:49:33 PM9/16/11
to psi-prob...@googlegroups.com
The snapshot build I sent you should have all the JSP mess cleaned up.  It also contains Tomcat 7 support.

Here's what's interesting to me.  The first error and the second error are really the same error...
  • java.lang.NoSuchMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext; 
  • The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
    One is a runtime error, and the other is a compile-time error (when it's compiling the JSP).  It may be an issue with your Tomcat, but let's see how that snapshot build works.

    Meik Behnfeldt

    unread,
    Sep 19, 2011, 2:46:10 AM9/19/11
    to psi-probe-discuss
    Hello Mark,

    I have just tested your snapshot build and still get the same error:

    --

    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:

    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:
    92)

    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:
    330)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:
    439)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)

    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:
    589)

    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
    317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
    313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:
    118)

    com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:
    52)

    --

    Maybe it is really an issue with my Tomcat server (version 6.0.24 as i
    wrote initially; I do not have the problem with a locally installed
    6.0.29 Tomcat).

    Regards

    Meik Behnfeldt

    Mark

    unread,
    Sep 19, 2011, 4:56:43 PM9/19/11
    to psi-prob...@googlegroups.com
    That's possible, although I didn't see anything in Tomcat's changelogs to suggest an error.  Did you make any changes to your 6.0.24 installation of Tomcat, like installing a new JSP library?

    Meik Behnfeldt

    unread,
    Sep 21, 2011, 4:17:51 AM9/21/11
    to psi-probe-discuss
    Hello Mark,

    the relevant Tomcat server was set up by our administration team (copy
    of another Tomcat server).

    PSI Probe did not work there because of a library in the lib directory
    which generated a conflict (class JspFactory).

    Thanks for your help!

    Regards

    Meik Behnfeldt

    Mark

    unread,
    Sep 21, 2011, 10:31:19 AM9/21/11
    to psi-prob...@googlegroups.com
    Haha, rockin'.  Happy to help.
    Reply all
    Reply to author
    Forward
    0 new messages