Wookie
  1. Wookie
  2. WOOKIE-105

Servlet.service() for servlet default threw exception java.lang.NoSuchMethodError

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: Server
    • Labels:
      None
    • Environment:
      I am running latest code from repository with https://issues.apache.org/jira/browse/WOOKIE-65 notifications_patch_2.txt patch applied on Tomcat 5.5.28, MySQL 5.1.38

      Description

      I updated source from svn and ran clean clean-db redeploy-webapp.
      Application goes up with no errors in log. But if I initiate a widget (e.g. weather) and open the <url> server throws an exception added below. It seems that server has trouble serving widget's .css file. If I go directly to http://localhost:8080/wookie/wservices/www.getwookie.org/widgets/weather/weather.css I will get the same exception.

      15:45:50,921 ERROR [default]:253 - Servlet.service() for servlet default threw exception
      java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
      at org.apache.wookie.server.LocalizedResourceFilter.getLocalizedResource(LocalizedResourceFilter.java:127)
      at org.apache.wookie.server.LocalizedResourceFilter.doFilter(LocalizedResourceFilter.java:85)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.wookie.server.CharSetFilter.doFilter(CharSetFilter.java:34)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.wookie.server.MainFilter.doFilter(MainFilter.java:42)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
      at java.lang.Thread.run(Thread.java:595)
      15:45:50,923 ERROR [default]:253 - Servlet.service() for servlet default threw exception
      java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
      at org.apache.wookie.server.LocalizedResourceFilter.getLocalizedResource(LocalizedResourceFilter.java:127)
      at org.apache.wookie.server.LocalizedResourceFilter.doFilter(LocalizedResourceFilter.java:85)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.wookie.server.CharSetFilter.doFilter(CharSetFilter.java:34)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.wookie.server.MainFilter.doFilter(MainFilter.java:42)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
      at java.lang.Thread.run(Thread.java:595)
      15:45:51,099 ERROR [default]:253 - Servlet.service() for servlet default threw exception
      java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
      at org.apache.wookie.server.LocalizedResourceFilter.getLocalizedResource(LocalizedResourceFilter.java:127)
      at org.apache.wookie.server.LocalizedResourceFilter.doFilter(LocalizedResourceFilter.java:85)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.wookie.server.CharSetFilter.doFilter(CharSetFilter.java:34)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.wookie.server.MainFilter.doFilter(MainFilter.java:42)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
      at java.lang.Thread.run(Thread.java:595)

        Activity

        Hide
        Scott Wilson added a comment -

        I can confirm this problem - as far as I can tell the cause is the version of the Servlet API implemented in Tomcat 5.x

        The problem should not occur on Tomcat 6.x

        I'm not sure what a workaround would be for Tomcat 5.x - this is the offending line:

        String context = filterConfig.getServletContext().getContextPath();

        Show
        Scott Wilson added a comment - I can confirm this problem - as far as I can tell the cause is the version of the Servlet API implemented in Tomcat 5.x The problem should not occur on Tomcat 6.x I'm not sure what a workaround would be for Tomcat 5.x - this is the offending line: String context = filterConfig.getServletContext().getContextPath();
        Hide
        allar added a comment -

        Thanks, it works fine with version 6.0.18.

        Show
        allar added a comment - Thanks, it works fine with version 6.0.18.
        Hide
        Ross Gardler added a comment -

        This is an issue with a specific version of Tomcat and a workaround has been proposed.

        Show
        Ross Gardler added a comment - This is an issue with a specific version of Tomcat and a workaround has been proposed.
        Hide
        Scott Wilson added a comment -

        I've added this workaround to the FAQ.

        Show
        Scott Wilson added a comment - I've added this workaround to the FAQ.

          People

          • Assignee:
            Unassigned
            Reporter:
            allar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development