raxvan
raxvan

Reputation: 11

eclipse servlet problem

i have created a dynamic web page for a servlet. When i try run the project i get the following error:

http starus 500

javax.servlet.ServletException: Error instantiating servlet class ch.uzh.ifi.attempto.aceeditor.MyMainServlet
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
 org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 java.lang.Thread.run(Unknown Source)

how can i fix this?

Upvotes: 1

Views: 1935

Answers (3)

Nivas
Nivas

Reputation: 18344

Can you check the following: Are the servlet entries proper in web.xml? (no spelling errors, correct package,...)

Is the servlet class is in classpath, in the same path as given in web.xml?

Looks like one of these.

What server are you using?

Upvotes: 0

raxvan
raxvan

Reputation: 11

I found that a basic test servlet is working. The basic servlet extends the class HttpServlet.

The servlet i want to run extends the WebContainerServlet class, so i believe that this is the source of the error.

The error i get now is

javax.servlet.ServletException: Error allocating a servlet instance org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) ... do you need me to post all the stack trace?

Upvotes: 0

duffymo
duffymo

Reputation: 308733

Can't tell from the stack trace - could be any number of things:

  1. Servlet .class file doesn't exist
  2. Servlet .class file not in proper package directory structure
  3. Servlet .class file not under WEB-INF/classes
  4. Servlet not registered properly in web.xml
  5. WAR file isn't correct.
  6. WAR file not deployed correctly.
  7. URL used to invoke servlet is incorrect.

I'd recommend starting with this and carefully reviewing what you've done, step by step.

Upvotes: 1

Related Questions