• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

unable to extract war file after restart of tomcat

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I'm using tomcat-4.1.29 on windows 2000
I'm trying to change the server.xml to add logging for a context.
when i add a logger to the context, the war file for the context is not getting extracted.
if i remove this context tag from server.xml the war gets extracted successfully so there's no problem in the war file.

The host tag is as following:
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">

The context tag in server.xml is as following :
<Context path="/Upload-C" docBase="Upload-C"
debug="0" privileged="true">

<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_upload-c_log." suffix=".txt"
timestamp="true"/>

</Context>

i believe that the problem is in the context tag, so what's going wrong here.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you looked in your logs to see what errors are being reported?
 
Milind Joshi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
2006-01-16 11:35:49 StandardContext[/Upload-C]: Resources start failed:
java.lang.IllegalArgumentException: Document base ..\webapps\..\webapps\Upload-C does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:193)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3344)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3474)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:754)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
 
Milind Joshi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The above error occured when I put the following context in server.xml
<Context path="/Upload-C" docBase="../webapps/Upload-C" debug="0" privileged="true" unpackWARs="true" autoDeploy="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_upload-c_log." suffix=".txt" timestamp="true"/></Context>

And if i change it to

<Context path="/Upload-C" docBase="/Upload-C" debug="0" privileged="true" unpackWARs="true" autoDeploy="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_upload-c_log." suffix=".txt" timestamp="true"/></Context>

I get the error :



2006-01-16 11:37:45 StandardContext[/Upload-C]: Resources start failed:
java.lang.IllegalArgumentException: Document base ..\webapps\Upload-C does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:193)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3344)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3474)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:754)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

2006-01-16 11:37:45 StandardContext[/Upload-C]: Context startup failed due to previous errors
2006-01-16 11:37:45 StandardContext[/Upload-C]: Exception during cleanup after start failed
LifecycleException: Container StandardContext[/Upload-C] has not been started
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3658)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3636)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:754)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Milind,
I think you haven't configured your docbase properly. Ensure that the path you mention there is correct. You can specify an absolute pathname for this web application or WAR file, or a pathname that is relative to the appBase directory of the owning Host.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you use a relative path for the docBase attribute, it needs to be relative to the tomcat/webapps directory (or whatever your appBase directory is, as defined in the Host node)
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Manoj KG
Welcome to JavaRanch!

We're pleased to have you here with us in the Tomcat forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
You can use initials for your first and middle name but not the last.

You can change it here
 
Manoj Kumkumath
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ben,
Believe me, that is my real complete name.

But as per the naming policy of the javaranch, I have added the family name.

-Manoj
 
Milind Joshi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I gave a relative path in the xml. But the problem still exists.
After updating this server.xml, If I put a new war file and delete the existing context and restart the tomcat it wont extract the war file.
If you dont mind, pls try out at your end.
1) stop tomcat
2) Modify server.xml and add a new context (say testcontext).
3) Put the relative war (testcontext.war) file in webapps folder.
4) Start the tomcat.
You'll find that no new context is created.

And If you remove the context entry from server.xml, restart tomcat, the respective context (testcontext) will get created in webapps folder.

Please let me know if you have any soulution.

Thanks
Milind
 
Manoj Kumkumath
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Milind,
Try giving entries as follows.
1)
<Context path="/Upload-C" docBase="../yourwarfile.war"
debug="0" privileged="true">

Also note
1)If D:\jakarta-tomcat-5.0.28\webapps is your webapps folder, your war file should be in D:\jakarta-tomcat-5.0.28

and

2) Your war file should have WEB-INF folder directory under the root in war file.
 
Manoj Kumkumath
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Point 3)
Ensure that your tomcat is started without any error or suspicious messages.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Manoj Kumkumath:
Ben,
Believe me, that is my real complete name.

But as per the naming policy of the javaranch, I have added the family name.

-Manoj



Thank you
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Milind Joshi:
I gave a relative path in the xml. But the problem still exists.
After updating this server.xml, If I put a new war file and delete the existing context and restart the tomcat it wont extract the war file.
If you dont mind, pls try out at your end.
1) stop tomcat
2) Modify server.xml and add a new context (say testcontext).
3) Put the relative war (testcontext.war) file in webapps folder.
4) Start the tomcat.
You'll find that no new context is created.

And If you remove the context entry from server.xml, restart tomcat, the respective context (testcontext) will get created in webapps folder.

Please let me know if you have any soulution.

Thanks
Milind





What is the value of your docBase attribute now?
What is the path to the directory that holds your web.xml file?
 
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic