It's not a secret anymore!*
The moose likes Tomcat and the fly likes problem when setting context in server.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "problem when setting context in server.xml" Watch "problem when setting context in server.xml" New topic
Author

problem when setting context in server.xml

Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
I have a directory named 'C:\projet\epfc' in my computer.
My server.xml is as follow :

<!-- Define properties for each web application. This is only needed
if you want to set non-default properties, or have web application
document roots in places other than the virtual host's appBase
directory. -->
<Context path="/epfc" docBase="../projet/epfc" debug="0"
reloadable="true"/>


<!-- Tomcat Root Context -->
<!--
<Context path="" docBase="ROOT" debug="0"/>
-->

<!-- Tomcat Examples Context -->

<Context path="/examples" docBase="examples" debug="0"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_examples_log." suffix=".txt"
timestamp="true"/>
....and so forth
I'm running tomcat 4.1.x. when i write http://localhost:8080/epfc/index.html , it doesn't work. Why ?
And the best I have no errors when i run tomcat.
My index.html exists.
Thank you for help.
Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
I changed docBase="../projet/epfc" debug="0" to "docBase=C:\projet\epfc" . it doesn't work again.
I'm waiting for your response.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

docbase="C:\\projet\\epfc"

- or -

docbase="c:/projet/epfc"
Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
Hi Mike, thank you for posting.
I tried both you said, it doesn't work
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

you are restarting Tomcat when you make changes to server.xml ?

what is the URL you are typing?

what is the error message in the browser?
are there any errors in any of these files:
stdout.log
stderr.log
localhost_log.2003-10-16.txt

does your projet/epfc directory contain a WEB-INF directory (MUST be all caps)?

Does the WEB-INF directory contain a web.xml file, that at minimum contains the following?:
Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
Hi Mike,
thank you very much. You was right , i had a exception throw in the log file because of my web.xml file. Now it works fine.
Thanks again
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem when setting context in server.xml
 
Similar Threads
Changing docbase?
Make Tomcat go
question related to servlet class and how to run it from Root
Configuration questions for Tomcat
Root Context - mywebapps has no effect