• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.lang.NoSuchMethodError: javax.servlet.ServletContext.getResourcePaths(Ljava/lang/String;)Ljava

 
sathish mssathish
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using tomcat,when i am called my home page,it shows following exception,how to solve it.

253 ) Servlet.service() for servlet jsp threw exception
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getResourcePaths(Ljava/lang/String;)Ljava/util/Set;
at org.apache.jasper.compiler.TldLocationsCache.processTldsInFileSystem(TldLocationsCache.java:425)
at org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:251)
at org.apache.jasper.compiler.TldLocationsCache.getLocation(TldLocationsCache.java:225)
at org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:527)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:423)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
at org.apache.jasper.compiler.Parser.parse(Parser.java:127)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
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:174)
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:874)
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)
 
Vijitha Kumara
Bartender
Posts: 3952
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sathish java wrote:i am using tomcat,when i am called my home page,it shows following exception,how to solve it.

253 ) Servlet.service() for servlet jsp threw exception
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getResourcePaths(Ljava/lang/String;)Ljava/util/Set;



Method signature is getResourcePaths(String arg0). Seems you have used String[] instead?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"sathish java",
Please check your private messages for an important administrative matter.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sathish java wrote:i am using tomcat,when i am called my home page,it shows following exception,how to solve it.



A NoSuchMethodError will be thrown when the class with the method was available in the classpath during compile time, but it is not available in the classpath during run time.

As that method was introduced in Servlet 2.3 API, it look like that you compiled it with Servlet 2.3 API or newer in the classpath and that you´re running it with Servlet 2.2 API or older in the classpath.

Now you have something to work with. Good luck.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijitha Kumara wrote:
sathish java wrote:i am using tomcat,when i am called my home page,it shows following exception,how to solve it.

253 ) Servlet.service() for servlet jsp threw exception
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getResourcePaths(Ljava/lang/String;)Ljava/util/Set;



Method signature is getResourcePaths(String arg0). Seems you have used String[] instead?

You´re wrong.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!