• 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

While depolying a WAR file using tomcat 404 error apperas

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
5:18 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Users\priscillak\apache-tomcat-7.0.27-windows-x86\apache-tomcat-7.0.27\webapps\admin.war
Aug 06, 2012 10:25:18 AM org.apache.catalina.startup.ContextConfig init
SEVERE: Exception fixing docBase for context [/admin]
java.io.FileNotFoundException: C:\Users\priscillak\apache-tomcat-7.0.27-windows-x86\apache-tomcat-7.0.27\webapps\admin.war (Access is denied)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.<init>(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(Unknown Source)
at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:112)
at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:716)
at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:820)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:363)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Aug 06, 2012 10:25:18 AM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\Users\priscillak\apache-tomcat-7.0.27-windows-x86\apache-tomcat-7.0.27\webapps\admin does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:140)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4894)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5074)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

this error message apperas in log file.anyone please help me
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you checked this file?

java.lang.IllegalArgumentException: Document base C:\Users\priscillak\apache-tomcat-7.0.27-windows-x86\apache-tomcat-7.0.27\webapps\admin does not exist or is not a readable directory
 
priscilla kurian
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Have you checked this file?

java.lang.IllegalArgumentException: Document base C:\Users\priscillak\apache-tomcat-7.0.27-windows-x86\apache-tomcat-7.0.27\webapps\admin does not exist or is not a readable directory



yes,I checked it.the .war file cannot be explored.
 
Ranch Hand
Posts: 136
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tomcat doesn't installed properly. So re install again and deploy it your problem gets solved
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sabarish Venkat wrote:tomcat doesn't installed properly. So re install again and deploy it your problem gets solved



I don't think that's the issue here.

yes,I checked it.the .war file cannot be explored.



What exactly do you mean by that? Is there a folder named admin under the webapps folder? And is there some xml file where you have made a mention of admin.war?
 
priscilla kurian
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I renistalled the tomcat.Then again the same problem appears.

I dont know what happens?please help me
 
priscilla kurian
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have worked in this way

I have imported a project in eclipse(juno) and add tomcat server(7.0.27).And using build.xml through run at server using ant builder.The .war files created in the tomcat webapp folder.The war file is in folder structer with .war in name(eg:admin.war folder).Then when I am trying to run the application using tomcat.http://localhost:8080 will works,when I am entering the war name.Page cannnot be displayed error appears(404).
And in the log file the following errors appears.

SEVERE: Exception fixing docBase for context [/admin]
java.io.FileNotFoundException: C:\Users\priscillak\apache-tomcat-7.0.27-windows-x86\apache-tomcat-7.0.27\webapps\admin.war (Access is denied)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.<init>(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(Unknown Source)
at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:112)
at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:716)
at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:820)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:363)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Aug 08, 2012 12:53:45 PM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\Users\priscillak\apache-tomcat-7.0.27-windows-x86\apache-tomcat-7.0.27\webapps\admin does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:140)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4894)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5074)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Aug 08, 2012 12:53:45 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error in resourceStart()
Aug 08, 2012 12:53:45 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
Aug 08, 2012 12:53:45 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/admin] startup failed due to previous errors
Aug 08, 2012 12:53:45 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Users\priscillak\apache-tomcat-7.0.27-windows-x86\apache-tomcat-7.0.27\webapps\assumption.war
Aug 08, 2012 12:53:45 PM org.apache.catalina.startup.ContextConfig init
SEVERE: Exception fixing docBase for context [/assumption]
java.io.FileNotFoundException: C:\Users\priscillak\apache-tomcat-7.0.27-windows-x86\apache-tomcat-7.0.27\webapps\assumption.war (Access is denied)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.<init>(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(Unknown Source)
at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:112)
at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:716)
at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:820)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:363)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Aug 08, 2012 12:53:45 PM org.apache.catalina.core.StandardContext resourcesStart
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


java.io.FileNotFoundException: C:\Users\priscillak\apache-tomcat-7.0.27-windows-x86\apache-tomcat-7.0.27\webapps\admin.war (Access is denied)



I notice that this message also appears for admin and assumption.war.

For Tomcat to properly serve a WAR, it must have read access rights to the WAR. When deploying as a WAR file to the TOMCAT_HOME/webapps directory, Tomcat must also have file access rights to the TOMCAT_HOME/webapps directory sufficient to read a WAR file, create a corresponding directory, and unzip (explode) the WAR file into that directory.

What is most likely wrong is that the user ID under which you are deploying the WAR has sufficient access rights to copy the WAR, but that the user ID under which Tomcat is running doesn't have sufficient access rights to complete the process.
 
priscilla kurian
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:


java.io.FileNotFoundException: C:\Users\priscillak\apache-tomcat-7.0.27-windows-x86\apache-tomcat-7.0.27\webapps\admin.war (Access is denied)



I notice that this message also appears for admin and assumption.war.

For Tomcat to properly serve a WAR, it must have read access rights to the WAR. When deploying as a WAR file to the TOMCAT_HOME/webapps directory, Tomcat must also have file access rights to the TOMCAT_HOME/webapps directory sufficient to read a WAR file, create a corresponding directory, and unzip (explode) the WAR file into that directory.

What is most likely wrong is that the user ID under which you are deploying the WAR has sufficient access rights to copy the WAR, but that the user ID under which Tomcat is running doesn't have sufficient access rights to complete the process.



But I set all permissions in tomcat,by using secutiy tab in folder.after that also the same error
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Setting the owner ID to "tomcat" wouldn't help should Tomcat not actually be running under user ID "tomcat". It has been known to happen.

You may also need to set parent folder permissions, though.
 
priscilla kurian
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But I have created another war file ,it works fine.
this war files are in folder structure with.war file extension.
that is not exploded
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately, I'm at my limit to what I can do without actual access to the offending machine. If it's any consolation, this sort of problem is the kind that I usually end up banging my head against the wall for 3 days, give up and ask a colleague and they look at it for 30 seconds and say something like "why is this setting here?" for something that should have been obvious.

Java does not attempt to play fancy games with OS file-protection services, however, so if it says "Access Denied", the OS really did deny access for a basic I/O or directory operation.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic