Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Wrapper cannot find servlet class

843841Apr 3 2007 — edited Oct 28 2008
Hi,
Sorry to trouble you all with a newbie Servlet question.

I am using JBoss. My servlet, HelloServlet, prints a simple Hello statement. I create a hello.war file with files

welcome.html
META-INF/Manifest.mf
WEB-INF/web.xml
WEB-INF/classes/HelloServlet.class


web.xml is as -

<?xml version="1.0"?>

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
<servlet>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>hello.HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<url-pattern>/HelloServlet/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>welcome.html</welcome-file>
</welcome-file-list>
</web-app>

I place the hello.war in the jboss/server/default/deploy directory. JBoss starts up fine saying that the war file has been deployed.
In my browser, I type
http://localhost:8080/hello/welcome.html
This works fine.

However when I do
http://localhost:8080/hello/HelloServlet

I get
"javax.servlet.ServletException: Wrapper cannot find servlet class hello.HelloServlet or a class it depends on"
and so on.
I have been following the SAMS Teach yourself EJB book.

Any help would be MUCH appreciated.

DG
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 25 2008
Added on Apr 3 2007
5 comments
789 views