wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Tomcat -why so fiddly? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat -why so fiddly?" Watch "Tomcat -why so fiddly?" New topic
Author

Tomcat -why so fiddly?

Steven Broadbent
Ranch Hand

Joined: Dec 10, 2002
Posts: 400
why is it so fiddly to get a new webapp working in tomcat?
I can get stuff to work inside an existing app like examples but when I move it into it's own structure
webapps/myapp/WEB-INF/web.xml
webapps/myapp/WEB-INF/classes/classes in here....
webapps/myapp/jsps in here
webapps/myapp/lib/nothing needed in this case
This just does not work, if this is the default set up
for a new webapp why is not picked up even after restarting the server?

End of Rant....thanks


"....bigmouth strikes again, and I've got no right to take my place with the human race...."<p>SCJP 1.4
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Moving to the Tomcat forum.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

You didn't mention a Tomcat version. I've never had any such problems using the 3.2.x and 4.1.x versions.
bear
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
In addition to setting up the new app and its directory in webapps, you also need to add a new context tag to the server.xml in tomcat/conf to let tomcat know that its there and what to do with it.
Steven Broadbent
Ranch Hand

Joined: Dec 10, 2002
Posts: 400
tried to hack one in using the examples already in there, but Tomcat wouldn't start. Have put server.xml back to it's original state now-
can't find example of how to add context element in the documentation anywhere.
Steven Broadbent
Ranch Hand

Joined: Dec 10, 2002
Posts: 400
Adding this to server.xml and it works:-
<Context
path="/worple"
docBase = "C:\Program Files\Apache Group\Tomcat 4.1\webapps\worple" debug="0" reloadable="true" crossContext="true"/>

webapps/worple has a single jsp and an empty WEB-INF directory.
This works via localhost:8080/worple/x.jsp
Guess this is the minimal set up for a new app.
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
That's a good start
link to tomcat server config reference
Review the server logs to see what the problem is with your myapp app, I suspect tomcat can't load it for some reason...or it choked on your hacked context
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat -why so fiddly?
 
Similar Threads
Tomcat 404 error
where to place .properties file
Why the user.dir is C:\WINNT\system32?
Add application context to WAS 5.0
path of a non-default app