Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Exception in Tomcat

 
Ravi Kishore Vaddiparthy
Greenhorn
Posts: 11
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heres my servlet files to update the data in database dynamically

update.html


web.xml


UpdateServlet.java




when i click update button it is not going to UpdateServlet throwing following error

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error instantiating servlet class UpdateServlet
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

root cause

java.lang.IllegalAccessException: Class org.apache.catalina.core.DefaultInstanceManager can not access a member of class UpdateServlet with modifiers ""
sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.8 logs.


Please help in executing this
Thank You
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13062
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


ALL classes used in servlets MUST be in a package, declared with the full package in the servlet tag AND stored according to the package under classes.

The reason being that without an explicit package, the JVM looks in the "current" directory, something you have no control over.

This error occurs time and again = if you scan the forum for problems similar to yours you would undoubtedly hit this solution.

Bill
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64856
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also covered in the ServletsFaq. Always read the FAQ before posting. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic