• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat -why so fiddly?

 
Steven Broadbent
Ranch Hand
Posts: 400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64615
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Tomcat forum.
bear
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64615
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 326
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 326
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic