Erik,

Applications gain their context environments in Tomcat as follows:

DefaultContext as defined in server.xml - all apps inherit from here.
Context - specific to the app in server.xml
web.xml - as in CATALINA_HOME/conf
web.xml - as in Webapps/app/WEB-INF

I have web.xml´s which only contain:

<?xml version="1.0" encoding="ISO-8859-1"?>
    <!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>App Name</display-name>
    <servlet>
        <servlet-name>App</servlet-name>
        <servlet-class>App</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>App</servlet-name>
        <url-pattern>/App</web-app></url-pattern>
    </servlet-mapping>
</web-app>

and even only:

<?xml version="1.0" encoding="ISO-8859-1"?>
    <!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>App Name</display-name>
</web-app>

if I don´t have a servlet.

I like my apps to inherit from DefaultContext and use Context to access Global 
Resources such as database connection pools.

Applications are easier to manage this way, and also save you having to debug your 
web.xml files. You just have to get your server.xml right!

Regards

Eric
-----Original Message-----
From: Price, Erik [mailto:[EMAIL PROTECTED]]
Sent: Donnerstag, 21. November 2002 16:03
To: Roberts, Eric; Tomcat Users List
Subject: RE: webapp fails to start using /manager & "start" command


Eric,

Great!  I didn't know about the log files, but that had the answer.  A SAX parse error 
in my WEB-INF/web.xml file.  This is kind of surprising since I just copied the 
web.xml file from the URL at

http://domainname:8080/tomcat-docs/appdev/web.xml.txt

and removed the ".txt" extension.

I realize that this example file is intended to be just that, an example, but did 
anyone know that it does not validate?  There is a <servlet> node called "graph" that 
is missing a <servlet-class> node.

It took me a few tries, some judicious log-reading, and some web.xml-editing, but I 
managed to get my webapp started!  The HelloWorld is just a start, but now I can move 
forward.

QUESTION:

How important is the web.xml file to a webapp?  All I did was comment the offending 
node and the webapp started.  I still have completely invalid data in the web.xml 
file.  The reason for this is that I have not really designed a webapp; this is just a 
testbed for miscellaneous servlets.

So until I have designed a true web application and created a "correct" web.xml file, 
does the web.xml file really matter?

Thanks again to all who help me on this list.

(Please CC me in response as I am a digester, thank you)


Erik




> -----Original Message-----
> From: Roberts, Eric [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 21, 2002 8:48 AM
> To: Tomcat Users List
> Subject: RE: webapp fails to start using /manager & "start" command
> 
> 
> Have you checked the log files to see if there is a reason as 
> to why the app could not be started?
> 
> -----Original Message-----
> From: Price, Erik [mailto:[EMAIL PROTECTED]]
> Sent: Donnerstag, 21. November 2002 14:43
> To: [EMAIL PROTECTED]
> Subject: webapp fails to start using /manager & "start" command
> 
> 
> Hello,
> 
> I checked the archives for this but couldn't find the answer 
> to my problem.  I created a new webapp yesterday and put it 
> into the $CATALINA_HOME/webapps directory.  From this list I 
> learned that it is possible to have a webapp recognized by 
> restarting Tomcat *OR* by adding a <Context> node into 
> $CATALINA_HOME/conf/server.xml that points to the path of the 
> webapp.  Since I do not have root access on this server, I 
> cannot change root-owned files and have asked my system 
> administrator to restart Tomcat for me, to get my webapp recognized.
> 
> He sent me an email saying that he gave me access to the 
> "manager" webapp, which I have studied from the HOWTO in the 
> documentation.  I understand how to use it, but I cannot get 
> my webapp to "start".  Is it possible to get a webapp to 
> start (for the very first time) from the "manager" webapp?  
> Or does Tomcat really need to be restarted completely?
> 
> When I list the webapps on the server using
> 
> http://domainname:8080/manager/list
> 
> I can see a list of the webapps that are recognized, 
> including my webapp.  But all of the other webapps are listed 
> as "running", and my own webapp looks like this:
> 
> /epricetest:stopped:0
> 
> So I thought that I might have to start the webapp using the 
> "start" command, so I try this:
> 
> http://domainname:8080/manager/start?path=/epricetest
> 
> But the error message I receive when I try this is
> 
> FAIL - Application at context path /epricetest could not be started
> 
> This does not match any of the error messages detailed in the 
> "manager" app HOWTO, so I am unsure of what is causing the 
> problem.  Could it be that to start a webapp for the very 
> first time, Tomcat must really be restarted?  (In which case, 
> there is no way to do it without bugging my system 
> administrator again?)
> 
> 
> Any suggestions?
> 
> Thank you,
> 
> 
> Erik
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
> 

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

Reply via email to