• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat -why so fiddly?

 
Ranch Hand
Posts: 400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the Tomcat forum.
bear
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic