File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Without ROOT directory

 
Damodar Mukherjee
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried?
Tell exactly how you tried to create another webapp.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also tell us what version of Java and what version of Tomcat you are using.
 
Damodar Mukherjee
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
    Posts: 135
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 13411
    Firefox Browser Redhat VI Editor
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 135
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 20
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 13411
    Firefox Browser Redhat VI Editor
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 13411
    Firefox Browser Redhat VI Editor
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 135
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yes I am using java 1.5.0_06
     
    Ben Souther
    Sheriff
    Posts: 13411
    Firefox Browser Redhat VI Editor
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 135
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 135
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    No Answer?
     
    Damodar Mukherjee
    Ranch Hand
    Posts: 135
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Finally I installed Tomcat 6 and jdk1.6.x
    It is running fine...
     
    Don't get me started about those stupid light bulbs.
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic