• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Request Resource not available JSP

 
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My app cannot locate the jsp file located in the main Beer-v1 folder .
I have checked and rechecked and can't seem to find what the problem is.

My Jsp file :result.jsp


Java file



Couldn't get any thing from the log files as well...

2011-03-12 06:31:46 Commons Daemon procrun stderr initialized
Mar 12, 2011 6:31:47 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Apache Software Foundation\Tomcat 5.5\bin;.;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;%CommonProgramFiles%\Microsoft Shared\Windows Live;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Lenovo\Bluetooth Software\;C:\Program Files\Lenovo\Bluetooth Software\syswow64;C:\Program Files (x86)\Java\jdk1.6.0_19\bin;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Common Files\Microsoft Shared\Windows Live
Mar 12, 2011 6:31:47 AM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 12, 2011 6:31:47 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 830 ms
Mar 12, 2011 6:31:48 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 12, 2011 6:31:48 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.33
Mar 12, 2011 6:31:48 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Mar 12, 2011 6:31:48 AM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 12, 2011 6:31:48 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 12, 2011 6:31:48 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/20 config=null
Mar 12, 2011 6:31:48 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Mar 12, 2011 6:31:48 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1017 ms

 
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In which directory is your result.jsp located?

Edit: Sorry, you said where it is located in the first sentence of your post.
 
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And what is your web.xml or maybe more important - what is the URL you mapped to the posted Servlet?
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And how do you know the "result.jsp" could not be found? Maybe your servlet code is simply not invoked...
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The error I am getting is :
description The requested resource (/Beer-V1/result.jsp) is not available.




My web.xml file is :



My result.jsp is :



Form.html is :



This is the url i am using :

http://localhost:8080/Beer-V1/form.html


I know my servlet is getting invoked as i verified it by adding some System.out.println() statments and all of them got executed


Now i am
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nabila,

This is strange, you are sure you are having the result.jsp in the same directory as the form.html, right? Directly under Beer-V1?

Just to exclude other issues, try changing:

RequestDispatcher view = request.getRequestDispatcher("result.jsp");


into

RequestDispatcher view = request.getRequestDispatcher("/result.jsp");

 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tried changing it , still getting the same result.

Double checked my directory structure
Beer-V1-->WEB-INF -----> classes ---->com->example----->model------>BeerExpert.class
--->form.html
--->result.jsp


Anything else i can try
I know it has to be something really silly!
 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yea, it got to be something silly, as the example you posted works fine on my tomcat 7. Take a look at the attachment for any differences with your version.

Cheers!

PS. I've commented all the model classes, as I don't have their source.
PS2. What extensions are allowed in javaranch? Zip, Jar, rar, tar.bz2, txt - all are rejected...

[edit] I removed the download link and added the zip file as attachment
Filename: NabilaProject.zip
File size: 5 Kbytes
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure it's not a stupid matter of an incorrect case, e.g. result.Jsp?
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not that I am aware of .
I have pretty much checked everything I could think of ..

One quick question..



If the result.jsp is not found how is 3 and 4 getting exectuted.
After

Thought it should stop there .

[edit] In the attachment you'll find my project
Filename: beerV1.zip
File size: 7 Kbytes
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Pedro Kowalski wrote:PS2. What extensions are allowed in javaranch? Zip, Jar, rar, tar.bz2, txt - all are rejected...


Just images - GIF, TIFF, BMP, PNG and JPEG.
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nabila,

I had a look at your problem and I saw the problem immediately

Your "result.jsp" is actually "result.jsp.txt", so I guess you created the file using some text editor (e.g. notepad) and notepad added ".txt" to the file. And that's why your servlet can't find the file. So remove ".txt" from "result.jsp.txt", so you'll get a real jsp and not a txt file and your example will work flawless

Kind regards,
Roel
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My stupid mistake

Thanks alot! You guys have been a great help !
 
There's a way to do it better - find it. -Edison. A better tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic