• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Facing problem while tomcat 5.5 serves css, and jsp

 
Bhagyashri Ajagare Pawar
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all members

Currently I have purchase one domain name and virtual dedicated server(Linux - Red hat fedora). I am using java and tomcat 5.5 on that server.
The problem I am facing is tomcat shows 404 error (description: The requested resource (/mytestpage.jsp) is not available.).
Is there any settings I require to view css and all jsp and html pages, Because when I installed tomcat it shows prper installetion and display tomcat default page properly.





 
Souvik Dasgupta
Ranch Hand
Posts: 95
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Are you putting your JSP files inside WEB-INF folder or sub-directory inside it?
 
Bhagyashri Ajagare Pawar
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My directory structure is like

Tomcat-5.5/webapps/ROOT/WEB-INF
Tomcat-5.5/webapps/ROOT/extra/css
Tomcat-5.5/webapps/ROOT/extra/images
Tomcat-5.5/webapps/ROOT/extra/js


My all JSP and html pages are inside ROOT directory
My css, images, js are inside extra/css, extra/images and extra/js directory resp.

my web.xml file is inside WEB-INF directory.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So why isn't the extra folder named in your URL?
 
Bhagyashri Ajagare Pawar
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually extra is a one of the directory where I put my all files which I am using in JSP and html pages.
e.g.


Also here I try both href="/extra/css/style.css" and href="extra/css/style.css"

And about other jsp pages like mytestpage.jsp, which I put inside ROOT directory directly.

 
Bhagyashri Ajagare Pawar
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have also tried to change default 8080 port to 8081, but same problem is happen with 8081.
Please some one help me... It's urgent...
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so there is a file called Tomcat-5.5/webapps/ROOT/mytestpage.jsp and when you enter http://localhost:8080/mytestpage.jsp into a browser, you get a 404 page?
 
Bhagyashri Ajagare Pawar
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Exactly happend same.
Even though for any jsp or html file other than index/default.jsp/html inside my ROOT directory, is showing error 404.
Also it will not link up with css file, images, or javascript files.
 
Swastik Dey
Rancher
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of keeping under ROOT, does it work if you put the files under some other directory, and access it through that?

for e.g. localhost:8080/mysite/mypage.jsp?
 
Eswar Nec
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bhagyashri,

Try this,

webapps/myjsp/mytestpage.jsp

webapps/myjsp/extra/images/sampleImage.jpg

webapps/myjsp/extra/css/sample.css

webapps/myjsp/extra/js/sample.js

mytestpage.jsp


And http://localhost:8080/myjsp/mytestpage.jsp
 
Bhagyashri Ajagare Pawar
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eswar Nec and Swastik Dey. Using another directory resolve my problem. But let me know why this happening? I mean what is the reason behind this?

 
Bhagyashri Ajagare Pawar
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it was working properly for two days.
but now it shows same error for "myjsp" directory...
 
Swastik Dey
Rancher
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try on an updated version of tomcat.
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are 2 reasons why I don't like to put webapps under ROOT.

1. There can be only 1 root webapp per host, and Tomcat is designed to contain multiple webapps. And my servers generally do so.

2. Tomcat is already shipped with its own root app. It does take a little bit of tweaking to replace it with another app.
 
Bhagyashri Ajagare Pawar
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there any possibility, that due to tomcat server runs out of memory? if it is what would be the solution?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is highly unlikely that this is a memory problem, but if it is, then you should at the least see some error messages in the log files. You should the log files regardless - there may be other problems.

It is also highly unlikely that Tomcat needs to be upgraded to a newer version (as was suggested earlier in this thread); Tomcat 5.5 works fine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic