This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

resource not found error

 
sanjana sanjay
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hiii
when i try to deploy my first jsp,which just displays helloworld on browser, i am getting "404-resource not found exception". my program is correct and it is perfect. i placed it in test folder and deployed it and the URL is "HTTP://localhost:8080/test/one.jsp" , but i am getting error. do we require any new settings for running jsp ??? can you please help me in resolving this issue!!! i dint placed it in WEB-INF folder!!!

 
Ahsan Bagwan
Ranch Hand
Posts: 247
1
Java MySQL Database Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i dint placed it in WEB-INF folder!!!

WEB-INF is hidden from the browser. So you should get the JSP generated HTML in your browser.

Could you show us your project folder structure and also your deployment decriptor (web.xml) ?
 
sanjana sanjay
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<!--one.jsp-->
<html>
<body>
<h1>
<%="helloworld"%></h1></body></html>

my directory structure is

test
|__WEB-INF__web.xml
|__one.jsp


<!--web.xml-->
<web-app>
</web-app>


the url which i used in the browser is http://localhost:8080/test/one.jsp
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One possible cause for "resource not found" is that the server does not recognize "test" as a legitimate web application - typically due to errors in the web.xml file.

Bill
 
sanjana sanjay
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cant we deploy one.jsp which i have posted earlier without web.xml file???
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sanjana sanjay wrote:cant we deploy one.jsp which i have posted earlier without web.xml file???


All .jsp, just like all .html .css or other resources must be in a directory structure that the server recognizes as a web application. Thus it must have a valid web.xml.

Bill
 
sanjana sanjay
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is what i am getting on tomcat console when i deploy my test/one.jsp

INFO:deploying web application directory test
jan 1, 2003 12:03:51 AM org.apache.coyote.http11.Http11Protocol start

INFO:starting coyote HTTP/1.1 on http-8086
jan 1, 2003 12:03:51 AM org.apache.jk.common.channelSocket init

INFO:JK:apj13 listening on 0.0.0.0:8009
jan 1, 2003 12:03:51 AM org.apache.jk.server.JKMain start

INFO:JK running ID=0 time=0/140 config=null
jan 1, 2003 12:03:51 AM org.apache.cataline.startup.catalina start

INFO: server startup in 2861 ms


it is listening on two different ports i.e on http-8086 and 0.0.0.0:8009....
is it correct or if it is wrong then how to change the port(0.0.0.0:8009 to 8086) and where to change???
is it is the reason for my jsp not getting deployed???


can you please give me the solution so that i can deploy my first jsp ???




 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your OP says:
i placed it in test folder and deployed it and the URL is "HTTP://localhost:8080/test/one.jsp"


that is port 8080 but your note above says:
it is listening on two different ports i.e on http-8086 and 0.0.0.0:8009....


The usual Tomcat install has built in html and jsp examples - can you access them?

Bill
 
sanjana sanjay
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry!!! the url is HTTP://localhost:8086/test/one.jsp
its a typing mistake!!!

now can you please solve my problem!!!
 
sanjana sanjay
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
heyyy!!!
can any one tell what are the environment variables i.e paths and classpaths which we need to set for running s simple jsp program.
jsp program is : one.jsp
<h1>helloworld</h1>

html program: one.html
<h1>helloworld</h1>

these are in test folder

when i deploy my html is running (url: http://localhost:8086/test/one.html) whereas my jsp is not running (url:http://localhost:8086/test/one.jsp) i am getting "RESOURCE NOT AVAILABLE ERROR "............
CAN ANY ONE HELP ME IN THIS ISSUE ??? PLZZZZZZZZZZZZ
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you configuring tomcat to find the web app in that location?
 
sanjana sanjay
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have set path=C:\Program Files\Java\jdk1.5.0_19\bin;.
and classpath=C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;.

and i have also set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_19;.

still jsp is giving 404 error.

do we require any extra settings???
 
Maneesh Godbole
Saloon Keeper
Posts: 10973
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's take one step back.
Did you deploy your application to Tomcat? How?
 
sanjana sanjay
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my jsp is: one.jsp
<h1>helloworld</h1>

i kept it in test folder

and took the test folder and placed it in webapps of tomcat!!!

i.e is i used hard deployment!!!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic