aspose file tools*
The moose likes JSP and the fly likes resource not found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "resource not found error" Watch "resource not found error" New topic
Author

resource not found error

sanjana sanjay
Greenhorn

Joined: Oct 01, 2013
Posts: 13
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

Joined: Oct 05, 2010
Posts: 162
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

Joined: Oct 01, 2013
Posts: 13
<!--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

Joined: Mar 22, 2000
Posts: 12835
    
    5
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

Joined: Oct 01, 2013
Posts: 13
cant we deploy one.jsp which i have posted earlier without web.xml file???
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
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

Joined: Oct 01, 2013
Posts: 13
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

Joined: Mar 22, 2000
Posts: 12835
    
    5
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

Joined: Oct 01, 2013
Posts: 13
sorry!!! the url is HTTP://localhost:8086/test/one.jsp
its a typing mistake!!!

now can you please solve my problem!!!
sanjana sanjay
Greenhorn

Joined: Oct 01, 2013
Posts: 13
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

Joined: Jan 10, 2002
Posts: 61756
    
  67

How are you configuring tomcat to find the web app in that location?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sanjana sanjay
Greenhorn

Joined: Oct 01, 2013
Posts: 13
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

Joined: Jul 26, 2007
Posts: 10535
    
    9

Let's take one step back.
Did you deploy your application to Tomcat? How?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
sanjana sanjay
Greenhorn

Joined: Oct 01, 2013
Posts: 13
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
 
subject: resource not found error