Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

New Context problem - Tomcat 4.1.12  RSS feed

 
Ken Pelletier
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've created a context for my webapp in server.xml so that I could set up a connection pool.
In doing so, Tomcat raises an exception on startup while trying to unpack the war, saying that the directory (into which it is trying to unpack) does not exist or is unreadable. If I create an empty directory there, it does start up, but of course, does not unpack.
Here's the top of the exception stack trace:

Here's root elem of the context from server.xml:

If I change the docbase to name the war (docBase="foobar.war"), the app runs, but does not unpack into a dir - this is not what I want.
It seems to be a catch-22. It won't start w/o an existing target directory to unpack into, and it won't unpack if the directory exists.
Obviously I've misunderstood something in the context declaration, but I'm stumped for the moment.
 
prabhat kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in server.xml files for the Host node "unpackWARs"
property should be set to true for automatic expansion
 
Ken Pelletier
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.
The unpackWARs element is set to "true".
The war does get unpacked when I don't have that context in server.xml ( of course, I need that there to set up my connection pool ).
As soon as I add the context, Tomcat startup fails with the above exception.
Maddening.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens if you add that context after the WAR has been unpacked?
Bill
 
alok verma
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The above problem in adding a new context can be easily solved if we use ant1.5.1 for the purpose of compiling,making war file etc.Also now there is particular order of declaration in WEB-INF folder of web.xml also as <servlet> etc .If u don't folow the order then it will the parser error.
We solved the above problem by using the docs provided at:
http://jakarta.apache.org/tomcat-4.1-doc/appdev/deployment and source organiztion,processes pages.There is a default build.xml is also provided and a sample project can be made with the help of this provided u r using tomcat-4.1.12.With various commands of ant as ant all
ant dist
u compile,make war file deployable in webapps.
Also there is an added facility in tomcat4.1.12.Tha manager facility which can accessed from main tomcat page but first setting the password in tomcat-users.xml in conf of tomcat as say
<user username="alok" password="alok" roles="standard,manager,admin"/>
and passing the usrname/pwd in the window opening while accessing the manager link from main page.
u can view all the deployed,running applications on tomcat.Reg manager docs of tomcat provided in tomcat itself can be referred.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!