aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Request Resource not available JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Request Resource not available JSP" Watch "Request Resource not available JSP" New topic
Author

Request Resource not available JSP

Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
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


The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
In which directory is your result.jsp located?

Edit: Sorry, you said where it is located in the first sentence of your post.
Piotr Nowicki
Ranch Hand

Joined: Jul 13, 2010
Posts: 610

And what is your web.xml or maybe more important - what is the URL you mapped to the posted Servlet?


OCP Java SE 6 Programmer, OCM Java SE 6 Developer, OCE Java EE 6 JSPSD, OCE Java EE 6 EJBD, OCE Java EE 6 JPAD, Spring 3.0 Core Professional.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4907
    
  10

And how do you know the "result.jsp" could not be found? Maybe your servlet code is simply not invoked...


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
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
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1518
    
  22

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

Joined: Nov 05, 2007
Posts: 661
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

Joined: Jul 13, 2010
Posts: 610

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


[Download NabilaProject.zip] Download

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4907
    
  10

Are you sure it's not a stupid matter of an incorrect case, e.g. result.Jsp?
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
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


[Download beerV1.zip] Download

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4907
    
  10

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
Bartender

Joined: Jul 19, 2004
Posts: 4907
    
  10

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

Joined: Nov 05, 2007
Posts: 661
My stupid mistake

Thanks alot! You guys have been a great help !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Request Resource not available JSP
 
Similar Threads
Issue with JAVA_HOME setup
Problem using hibernate
What exactly am I supposed to do?
New Windows Install of Eclipse 3.3.2, Tomcat 6.0.16, & Plugin
java.lang.NullPointerException