We help IT Professionals succeed at work.
Get Started

Servlet not working

mike9483
mike9483 asked
on
1,110 Views
Last Modified: 2013-12-02
Hi I have moved my existing web app from JBoss to Tomcat 6.0. The web app has deployed mostly successfully but I am battling to get a servlet to run on the new web app. I am getting a class not found error. I have checked the web.xml files and I believe configuration is correct. Please help.
 
The stack trace error I am getting is as follows:
Nov 2, 2011 11:54:43 AM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet FileDownload as unavailable
Nov 2, 2011 11:54:43 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet FileDownload
java.lang.ClassNotFoundException: javax.ejb.CreateException
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getDeclaredMethods(Unknown Source)
        at org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:226)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1120)
        at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Unknown Source)

Extract from web.xml is as follows:

    <servlet>
        <servlet-name>FileDownload</servlet-name>
        <servlet-class>za.co.oneTwoOne.servlets.FileDownload</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>FileDownload</servlet-name>
        <url-pattern>/FileDownload</url-pattern>
    </servlet-mapping>

The FileDownload class is located in /WEB-INF/classes/za.co.oneTwoOne.servlets

Please help.


Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE