java.lang.NoSuchMethodError: net.bull.javamelody.Log4JAppender.setThreshold(Lorg/apache/log4j/Priority;)V

GitHub | Foxswily | 4 months ago
  1. 0

    GitHub comment 566#241438602

    GitHub | 4 months ago | Foxswily
    java.lang.NoSuchMethodError: net.bull.javamelody.Log4JAppender.setThreshold(Lorg/apache/log4j/Priority;)V
  2. 0

    Incompatibility with Quartz 2.*

    GitHub | 1 year ago | GoogleCodeExporter
    java.lang.NoSuchMethodError: org.quartz.Scheduler.addGlobalJobListener(Lorg/quartz/JobListener;)V
  3. 0

    NoSuchMethodError in Bamboo 2.6.1

    GitHub | 1 year ago | GoogleCodeExporter
    java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String when installing the JavaMelody plugin. This issue is based on the initial issue submitted at http://code.google.com/p/javamelody/issues/detail?id=37 Steps to reproduce: 1. Download the JavaMelody plugin from https://plugins.atlassian.com/plugin/details/20909 2. Copy the jar into the webapp/WEB-INF/lib folder 3. Start Bamboo (2.6.1) 4. Tail the bamboo log file The Bamboo logs show this stack trace when JavaMelody is installed in Bamboo 2.6.1: 2010-07-16 14:40:46,712 ERROR [796347291@qtp-745957924-0] [DefaultServletModuleManager] Unable to create filter com.atlassian.plugin.servlet.util.LazyLoadedReference$InitializationException: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String; at com.atlassian.plugin.servlet.util.LazyLoadedReference.get(LazyLoadedReference.java:94) at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilter(DefaultServletModuleManager.java:321) at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilters(DefaultServletModuleManager.java:188) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:53) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:378) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String; at net.bull.javamelody.Parameters.getContextPath(Parameters.java:328) at net.bull.javamelody.MonitoringFilter.init(MonitoringFilter.java:94) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.init(DelegatingPluginFilter.java:43) at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedFilterReference.create(DefaultServletModuleManager.java:371) at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedFilterReference.create(DefaultServletModuleManager.java:356) at com.atlassian.plugin.servlet.util.LazyLoadedReference$1.call(LazyLoadedReference.java:62) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at com.atlassian.plugin.servlet.util.LazyLoadedReference.get(LazyLoadedReference.java:74) My analysis: This ServletContext.getContextPath() method is called by the javamelody plugin only if the servlet api version is 2.5 or more. So the fact that the method is called in Bamboo v2.6.1 Build 1902 / jetty v6.1.15 implies that ServletContext.getMajorVersion() has returned 2 and that ServletContext.getMinorVersion() has returned 5. But the method call in the plugin throws "java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;", even if this method is supposed to exists in the servlet api 2.5. This issue implies that in this setup (in a plugin with bamboo 2.6.1 Build 1902 and jetty v6.1.15), the servlet api 2.5 was broken somehow: the method must exists. This is probably related to the fact that there are both servlet-api-2.4.jar and servlet-api-2.5.jar in "Bamboo/webapp/WEB-INF/lib/". Workaround: The following workaround was tested with success: 1. stop the bamboo server 2. backup and delete the file "Bamboo/webapp/WEB-INF/lib/servlet-api-2.4.jar" from your bamboo setup (but keep the servlet-api-2.5.jar) 3. restart the bamboo server 4. install the javamelody plugin Thanks anyway for a great plugin architecture. PS: The JavaMelody plugin goal is to monitor JIRA, Confluence and Bamboo servers.

    Atlassian JIRA | 6 years ago | Emeric Vernat
    com.atlassian.plugin.servlet.util.LazyLoadedReference$InitializationException: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
  6. 0

    NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String when installing the JavaMelody plugin. This issue is based on the initial issue submitted at http://code.google.com/p/javamelody/issues/detail?id=37 Steps to reproduce: 1. Download the JavaMelody plugin from https://plugins.atlassian.com/plugin/details/20909 2. Copy the jar into the webapp/WEB-INF/lib folder 3. Start Bamboo (2.6.1) 4. Tail the bamboo log file The Bamboo logs show this stack trace when JavaMelody is installed in Bamboo 2.6.1: 2010-07-16 14:40:46,712 ERROR [796347291@qtp-745957924-0] [DefaultServletModuleManager] Unable to create filter com.atlassian.plugin.servlet.util.LazyLoadedReference$InitializationException: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String; at com.atlassian.plugin.servlet.util.LazyLoadedReference.get(LazyLoadedReference.java:94) at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilter(DefaultServletModuleManager.java:321) at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilters(DefaultServletModuleManager.java:188) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:53) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:378) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String; at net.bull.javamelody.Parameters.getContextPath(Parameters.java:328) at net.bull.javamelody.MonitoringFilter.init(MonitoringFilter.java:94) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.init(DelegatingPluginFilter.java:43) at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedFilterReference.create(DefaultServletModuleManager.java:371) at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedFilterReference.create(DefaultServletModuleManager.java:356) at com.atlassian.plugin.servlet.util.LazyLoadedReference$1.call(LazyLoadedReference.java:62) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at com.atlassian.plugin.servlet.util.LazyLoadedReference.get(LazyLoadedReference.java:74) My analysis: This ServletContext.getContextPath() method is called by the javamelody plugin only if the servlet api version is 2.5 or more. So the fact that the method is called in Bamboo v2.6.1 Build 1902 / jetty v6.1.15 implies that ServletContext.getMajorVersion() has returned 2 and that ServletContext.getMinorVersion() has returned 5. But the method call in the plugin throws "java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;", even if this method is supposed to exists in the servlet api 2.5. This issue implies that in this setup (in a plugin with bamboo 2.6.1 Build 1902 and jetty v6.1.15), the servlet api 2.5 was broken somehow: the method must exists. This is probably related to the fact that there are both servlet-api-2.4.jar and servlet-api-2.5.jar in "Bamboo/webapp/WEB-INF/lib/". Workaround: The following workaround was tested with success: 1. stop the bamboo server 2. backup and delete the file "Bamboo/webapp/WEB-INF/lib/servlet-api-2.4.jar" from your bamboo setup (but keep the servlet-api-2.5.jar) 3. restart the bamboo server 4. install the javamelody plugin Thanks anyway for a great plugin architecture. PS: The JavaMelody plugin goal is to monitor JIRA, Confluence and Bamboo servers.

    Atlassian JIRA | 6 years ago | Emeric Vernat
    com.atlassian.plugin.servlet.util.LazyLoadedReference$InitializationException: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoSuchMethodError

      net.bull.javamelody.Log4JAppender.setThreshold(Lorg/apache/log4j/Priority;)V

      at net.bull.javamelody.Log4JAppender.<init>()
    2. net.bull.javamelody
      MonitoringFilter.init
      1. net.bull.javamelody.Log4JAppender.<init>(Log4JAppender.java:42)
      2. net.bull.javamelody.Log4JAppender.<clinit>(Log4JAppender.java:34)
      3. net.bull.javamelody.FilterContext.initLogs(FilterContext.java:283)
      4. net.bull.javamelody.FilterContext.<init>(FilterContext.java:70)
      5. net.bull.javamelody.MonitoringFilter.init(MonitoringFilter.java:112)
      5 frames
    3. Glassfish Core
      ApplicationFilterConfig.initFilter
      1. org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
      1 frame