aspose file tools*
The moose likes Tomcat and the fly likes Without ROOT directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Without ROOT directory" Watch "Without ROOT directory" New topic
Author

Without ROOT directory

Damodar Mukherjee
Ranch Hand

Joined: Mar 20, 2007
Posts: 135
Hi,
I am not able to run a web application ibn other directory then ROOT directory in webapp. Can any one please help me regarding the same.

Thanks in advance.


SCJP 1.5, SCWCD 1.4, Next... SCBCD5
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

What have you tried?
Tell exactly how you tried to create another webapp.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14269
    
  21

Also tell us what version of Java and what version of Tomcat you are using.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Damodar Mukherjee
Ranch Hand

Joined: Mar 20, 2007
Posts: 135
I am using j2ee1.4 and tomcat 5.5

I created a directory under webapps, configurd the web.xml file and put an index.jsp file in the directory webapp/dirname but I am unable to access it. My browser shows that page not found. but it is working fine in ROOT directory.

in server.xml in conf the setting is <Context path="" docBase="ROOT" debug="0"/> but I tried

<Context path="" docBase="" debug="0"/>

it is also now working for ROOT directoy but not other directory...


Please hep me.

Thanking you,
Damodar.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You don't need to do anything with server.xml.
Remove everything that you put in that file.

Where did you put your deployment descriptor (web.xml file)?
It needs to be under WEB-INF.

Tomcat looks in its webapps directory for war files or directories that contain a WEB-INF directory in them and deploys them as web applications.

So, the simplest way to create a web application in Tomcat is to:'
  • Create a directory under webapps (let's call it myapp)
  • Inside the myapp directory, create another directory named WEB-INF (case sensitive)
  • Also inside myapp, create a simple helloworld JSP file.


  • That's it.
    A deployment descriptor is a good idea but is not needed by Tomcat.
    It just needs to see a WEB-INF directory inside your application's root directory (myapp).
    Damodar Mukherjee
    Ranch Hand

    Joined: Mar 20, 2007
    Posts: 135
    I did all these things you told. Infat when I renamed the ROOT directory it is not working. Example http://localhost:8080/ working but http://localhost:8080/ROOT1 is not (I just renamed ROOT to ROOT1)

    Please Help...
    Ben Souther
    Sheriff

    Joined: Dec 11, 2004
    Posts: 13410

    Originally posted by Damodar Mukherjee:
    I did all these things you told. Infat when I renamed the ROOT directory ...


    Where did I ever say to rename the ROOT directory?
    Damodar Mukherjee
    Ranch Hand

    Joined: Mar 20, 2007
    Posts: 135
    That I want to say that I i all the same configuration as ROOT directory but it is not still working. I did all the things you said...
    hemant chaudhary
    Greenhorn

    Joined: Feb 22, 2007
    Posts: 20
    For me also it was not working(I had tomcat 4.1 i unstalled that one and installed tomcat 6...it is working now but still I m not able to run index.html like this :


    http://localhost:8080/ROOT/index.html

    but this :
    http://localhost:8080 is working for same index.html

    I don't know whether this normal behavior or some error it is giving.
    Ben Souther
    Sheriff

    Joined: Dec 11, 2004
    Posts: 13410

    hemant chaudhary,
    Please don't hi-jack other people's threads.
    You're using a different version and will need to do things differently.
    Please start a new topic for your question.
    Ben Souther
    Sheriff

    Joined: Dec 11, 2004
    Posts: 13410

    Originally posted by Damodar Mukherjee:
    I am using j2ee1.4 and tomcat 5.5


    OK, Tomcat 5.5 requires a JDK1.5 unless you've also installed the compat package that makes it work with 1.4. Have you done that?
    Damodar Mukherjee
    Ranch Hand

    Joined: Mar 20, 2007
    Posts: 135
    Yes I am using java 1.5.0_06
    Ben Souther
    Sheriff

    Joined: Dec 11, 2004
    Posts: 13410

    I am using j2ee1.4 and tomcat 5.5


    I just noticed that the above says j2ee1.4 (not j2sdk1.4).

    Tomcat ships with the parts of j2ee that it needs so you don't need it on your system to run Tomcat.
    Where did you put the j2ee.jar file?.

    I've heard of cases where having that in the jdk/tools directory or within Tomcat can foul things up.
    Damodar Mukherjee
    Ranch Hand

    Joined: Mar 20, 2007
    Posts: 135
    I have not putted any where the j2ee.jar file neither in apache nor in j2eesdk-1_4_03/jre/lib directory.
    Damodar Mukherjee
    Ranch Hand

    Joined: Mar 20, 2007
    Posts: 135
    No Answer?
    Damodar Mukherjee
    Ranch Hand

    Joined: Mar 20, 2007
    Posts: 135
    Finally I installed Tomcat 6 and jdk1.6.x
    It is running fine...
     
    Don't get me started about those stupid light bulbs.
     
    subject: Without ROOT directory