http404 error in tomcat5.5.9

2005-08-18 Thread Duan Xin
hi , I have some questions in using tomcat 5.5.9:
I create my web application under myapp directory (the structure of directory 
is below:)
{
myapp(dir)---
   ---WEB-INF(dir)---classes(dir)---HelloWorld.class
---web.xml
---context.xml
   ---index.jsp

web.xml:
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
 PUBLIC -//Sun Microsysems, Inc.//DTD Web Application 2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;
 
web-app
display-nameMy Web Application/display-name
descriptionA application for test./description

!-- JSPC servlet mappings start --
servlet
servlet-nameHelloWorld/servlet-name
servlet-classHelloWorld/servlet-class
/servlet

servlet-mapping
servlet-nameHelloWorld/servlet-name
url-pattern/servlet/HelloWorld/url-pattern
/servlet-mapping

!-- JSPC servlet mappings end --   

/web-app

context.xml
Context path=/myapp docBase=${catalina.home}/webapps/myapp debug=0 
reloadable=true/
 }

and deploy it under {catalina.home}/webapps directory . Then i restart tomcat 
and try to open my application by using http://localhost:8080/myapp/index.jsp 
but tomcat report a http404 error . After i added Context path=/myapp 
docBase=${catalina.home}/webapps/myapp debug=0 reloadable=true/ to the 
element of  Host of server.xml file and restart tomcat ,the problem still 
existed.  Also ,I fail to use tomcat web application manager to start the 
application : when I click the Start command ,the manager report: FAIL - 
Application at context path /myapp could not be started .
I  noticed that if  I put my application under {catalina.home}/webapps /ROOT 
directory and using http://localhost:8080/myapp/index.jsp ,it can work.But when 
I try to test my servlet by using 
http://localhost:8080/myapp/servlet/HelloWorld  ,the http404 error occured 
again .
Who can tell me how to do?

Re: http404 error in tomcat5.5.9

2005-08-18 Thread Jon Wingfield
I'm not sure the whitespace in your directory structure came out right 
so I'll make a few comments:


web.xml should be in myapp/WEB-INF
context.xml should be in myapp/META-INF (or rename it to myapp.xml and 
move it to the webapps directory)


Your servlet class should be in a package. Have a look at :
http://jakarta.apache.org/tomcat/faq/classnotfound.html
and the Http-status 500 error in Tomcat 4.1 thread on this list today.

HTH,

Jon

Duan Xin wrote:

hi , I have some questions in using tomcat 5.5.9:
I create my web application under myapp directory (the structure of directory 
is below:)
{
myapp(dir)---
   ---WEB-INF(dir)---classes(dir)---HelloWorld.class
---web.xml
---context.xml
   ---index.jsp

web.xml:
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
 PUBLIC -//Sun Microsysems, Inc.//DTD Web Application 2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;
 
web-app

display-nameMy Web Application/display-name
descriptionA application for test./description

!-- JSPC servlet mappings start --
servlet

servlet-nameHelloWorld/servlet-name
servlet-classHelloWorld/servlet-class
/servlet

servlet-mapping

servlet-nameHelloWorld/servlet-name
url-pattern/servlet/HelloWorld/url-pattern
/servlet-mapping

!-- JSPC servlet mappings end --   


/web-app

context.xml
Context path=/myapp docBase=${catalina.home}/webapps/myapp debug=0 
reloadable=true/
 }

and deploy it under {catalina.home}/webapps directory . Then i restart tomcat and try to open my application by using http://localhost:8080/myapp/index.jsp but 
tomcat report a http404 error . After i added Context path=/myapp docBase=${catalina.home}/webapps/myapp debug=0 
reloadable=true/ to the element of  Host of server.xml file and restart tomcat ,the problem still existed.  Also ,I fail to use tomcat 
web application manager to start the application : when I click the Start command ,the manager report: FAIL - Application at context path 
/myapp could not be started .
I  noticed that if  I put my application under {catalina.home}/webapps /ROOT 
directory and using http://localhost:8080/myapp/index.jsp ,it can work.But when 
I try to test my servlet by using 
http://localhost:8080/myapp/servlet/HelloWorld  ,the http404 error occured 
again .
Who can tell me how to do?




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]