Help with deploying a servlet
spob Oct 25, 2002 2:30 PMI've taken the standard template example and attempted to extend it with a simple servlet. My war file has the following contents:
C:\java\dev\jbosstest\build\deploy>jar -tf web-client.war
META-INF/
META-INF/MANIFEST.MF
index.jsp
WEB-INF/
WEB-INF/lib/
WEB-INF/classes/
WEB-INF/classes/org/
WEB-INF/classes/org/sturim/
WEB-INF/classes/org/sturim/edb/
WEB-INF/classes/org/sturim/edb/common/
WEB-INF/classes/org/sturim/edb/common/interfaces/
WEB-INF/classes/test/
WEB-INF/classes/test/interfaces/
WEB-INF/classes/test/interfaces/AbstractData.class
WEB-INF/classes/test/interfaces/InvalidValueException.class
WEB-INF/classes/test/interfaces/SequenceGenerator.class
WEB-INF/classes/test/interfaces/SequenceGeneratorHome.class
WEB-INF/classes/test/interfaces/ServiceUnavailableException.class
WEB-INF/classes/test/interfaces/TestBMPEntity.class
WEB-INF/classes/test/interfaces/TestBMPEntityData.class
WEB-INF/classes/test/interfaces/TestBMPEntityHome.class
WEB-INF/classes/test/interfaces/TestBMPEntityPK.class
WEB-INF/classes/test/interfaces/TestEntity.class
WEB-INF/classes/test/interfaces/TestEntityData.class
WEB-INF/classes/test/interfaces/TestEntityHome.class
WEB-INF/classes/test/interfaces/TestEntityPK.class
WEB-INF/classes/test/interfaces/TestSession.class
WEB-INF/classes/test/interfaces/TestSessionHome.class
WEB-INF/classes/org/sturim/Test.class
WEB-INF/jboss-web.xml
WEB-INF/web.xml
My servlet is contained in the WEB-INF/classes/org/sturim/Test.class entry.
The only change I've made to the original template code is to add a very simple servlet (that does nothing except print a message) called org.sturim.Test. I've added the servlet to the web.xml file as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<display-name>Web Client</display-name>
<servlet-name>Test</servlet-name>
<servlet-class>org.sturim.Test</servlet-class>
<load-on-startup>2000</load-on-startup>
<!-- The Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<ejb-ref>
<ejb-ref-name>ejb/webtest/TestSession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
test.interfaces.TestSessionHome
test.interfaces.TestSession
</ejb-ref>
</web-app>
I can access the sample index.jsp file that was shipped as part of the original template code by typing:
http://localhost:8080/web-client/index.jsp
I know my servlet is deployed properly because I set it to load on startup, and I can see my debug message printed to the log.
I get no errors when I deploy my web-client.war to %JBOSS_HOME%\server\default\deploy.
But if I try to access my servlet such as:
http://localhost:8080/web-client/Test, I get a 404 error. I get the same message if I get
http://localhost:8080/web-client/servlet/Test.
Any ideas would be greatly appreciated.