• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Problem running simple Servlet on Tomcat

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having problems trying to get a simple servlet to run on Tomcat6.0 on WinXP
I am seeing the following error

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\webapps\MyFristApp does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:141)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3941)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4112)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
16-Feb-2007 22:48:59 org.apache.catalina.core.StandardContext start


My set up is as follows

C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyFristApp
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyFristApp\Images
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyFristApp\META-INF
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyFristApp\WEB-INF\classes
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyFristApp\WEB-INF\lib
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyFristApp\WEB-INF\web.xml

In my server.xml file I have added the following

<Context path="/MyFirstApp" docBase="MyFirstApp" crossContext="true" debug="0" reloadable="true" trusted="false"></Context>


any one know whey I am seeing the error

java.lang.IllegalArgumentException: Document base C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\webapps\MyFristApp does not exist or is not a readable directory.


Thanks in advance for any help.

[ February 16, 2007: Message edited by: IdrisK ]

[ February 16, 2007: Message edited by: IdrisK ]
[ February 16, 2007: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 67590
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
If you check the message carefully:

you will see that the path specified does not match your setup.

How are you addressing the servlet such that there's an extra webapps in there?

Also, check your spelling of "First".
[ February 16, 2007: Message edited by: Bear Bibeault ]
 
Idris Pathan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply Bear Bibeault,

Yes changed my setup to
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\webapps\MyFirstApp
so that it is the same as my Context path in server.xml

Context path="/MyFirstApp" docBase="MyFirstApp" crossContext="true" debug="0" reloadable="true" trusted="false"></Context>



But still getting the error

java.lang.IllegalArgumentException: Document base C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\webapps\MyFristApp does not exist or is not a readable directory.

I am not sure where this path is coming from, I have checked the server.xml
The web.xml is as follows.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
<servlet>
<servlet-name>

</servlet-name>
<servlet-class>

</servlet-class>
<init-param>
<param-name>
Log
</param-name>
<param-value>
C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin
</param-value>
</init-param>
<param-name>
Path
</param-name>
<param-value>
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyFristApp
</param-value>
</init-param>
<init-param>
<param-name>
Port
</param-name>
<param-value>
1998
</param-value>
</init-param>

</servlet>
<servlet>
<servlet-name>

</servlet-name>

</servlet-class>
<init-param>
<param-name>
Log
</param-name>
<param-value>
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyFirstApp\Logs
</param-value>
</init-param>
<init-param>
<param-name>
Path
</param-name>
<param-value>
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyFirstApp
</param-value>
</init-param>
<init-param>
<param-name>
Port
</param-name>
<param-value>
2001
</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>

</servlet-name>
<url-pattern>
/patcher.html
</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>
Manager
</servlet-name>
<url-pattern>
/Manager.html
</url-pattern>
</servlet-mapping>
</web-app>


Any ideas as to where its picking this path up from?
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\webapps\MyFristApp
[ February 16, 2007: Message edited by: Idris Pathan ]
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check your server.xml file (tomcathome/conf/server.xml)
is there a <context> element with a reference to the problem directory?
yes : remove it.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Eclipse: Just go to the server that you have configured , right click -> Add and Remove: and then remove all the not used projects or the ones that you have deleted before, the error should not come anymore !
 
Bear Bibeault
Sheriff
Posts: 67590
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
Who's said eclipse was being used?
 
What a show! What atmosphere! What fun! What a tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic