Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Context & manager 2

Status
Not open for further replies.

newbutold

Programmer
Feb 20, 2002
4
CA
I have 2 basic problems:...

1. I created a DIR'y under webapps and placed both a .jsp and ,html file in there to make sure I could run it and I modified the server.xml file to add a Context line for the new directory. I couldn't get them to execute got a 404 error. This is the entries in the server.xml file (usedcontainer is the directory I created):

<Context path=&quot;&quot; docBase=&quot;ROOT&quot; debug=&quot;0&quot;>

<Context path=&quot;/usedcontainer&quot; docbase=&quot;usedcontainer&quot;
debug=&quot;0&quot; reloadable=&quot;true&quot;>
<!-- Tomcat Manager Context -->
<Context path=&quot;/manager&quot; docBase=&quot;manager&quot;
debug=&quot;0&quot; privileged=&quot;true&quot;>

<!-- Tomcat Examples Context -->
<Context path=&quot;/examples&quot; docBase=&quot;examples&quot; debug=&quot;0&quot;
reloadable=&quot;true&quot; crossContext=&quot;true&quot;/>

2. I can't get the manager to allow me access even though I added my self as manager with the &quot;manager&quot; keyword as a parameter. Not sure what I did wrong herer either. This is the line I added:

<user name=&quot;Brian&quot; password=&quot;Parker&quot; roles=&quot;manager&quot; />

Any help here would be much appreciated. This the first time I have tried working with Tomcat.
Thanks, Brian
 
You do not need to explicitly add an application to the server.xml file in order to have a functioning web application. I recall reading some documentation somewhere that said the only thing needed for any application to be accessible was to include a /WEB-INF/web.xml file.

I just tried this in Tomcat 4.0.3 and could access a jsp file after I added /WEB-INF directory and included the web.xml file. Just copy a web.xml file from another pre-existing application.

pfist
 
Thanks Pfist for the help. I tried as you suggested and it worked. I am new to Java and Tomcat. I have another error to over come when I execute the jsp. I get the following error. I think it is a pathing issue. My paths look OK classpath = &quot;&quot;,
java_home and catalina_home look OK. Any suggestions ....

THE ERRORs:

This error
javax.servlet.ServletException: sun/tools/javac/Main
.
.
.
followed by this ROOT Cause...
java.lang.NoClassDefFoundError: sun/tools/javac/Main
.
.
.
Thanks again...

newbutold
 
All your class files have to be in a folder 'classes'
in WEB-INF folder
if you are accessing a servlet put the class files in that folder.
 
Thanks Javiv,

I will try this out....

newbutold
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top