• 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

Unable to locate the .jsp file error

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CAn someone help me understand why am I getting "message /SQL.jsp description The requested resource (/SQL.jsp) is not available. for the following. Both .html and .jsp files are in WEBContent folder only. And I copied the jar files. Independently when I run the programs both are running fine. In SQL.jsp file Query I gave deptno =10 to check and its showing me the output. The only problem is the server is not able to locate SQL.jsp. I dont udnerstand why.







Thank you
 
Ranch Hand
Posts: 344
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure if HTML and JSP files will work when they are located under WEB-INF... try to move them one directory "up" from there...
 
Siri Naray
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I gave it wrong. They are actually saved in Web-Contents folder.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Web-Contents? Is this within an IDE? There's no such folder that's standard.
 
Koen Aerts
Ranch Hand
Posts: 344
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, what is the context path of your web app (you can see that for instance in your URL)? It seems to be looking for something under / but if your web app is located under in context path, for instance http://localhost/mywebapp/index.jsp and you're trying to access http://localhost/index.jsp then it won't work.
 
Siri Naray
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
its WebContent in Eclipse
 
Koen Aerts
Ranch Hand
Posts: 344
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, are you sure the requests match the jsp file name and cases exactly; SQL.jsp and not sql.jsp, or Sql.jsp, etc.?
 
Siri Naray
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more point I observed is.. When I rename SQL.jsp to anyother name like JSTLSql.jsp and now run it still shows the old SQL.jsp file name. I have to exit the Eclipse for any changes to be effective. Why?
 
Koen Aerts
Ranch Hand
Posts: 344
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sirisha Ghatty wrote:One more point I observed is.. When I rename SQL.jsp to anyother name like JSTLSql.jsp and now run it still shows the old SQL.jsp file name. I have to exit the Eclipse for any changes to be effective. Why?


It depends on how you rename the file. If you do it through Eclipse, it should refresh automatically, if you do it outside of Eclipse (i.e. file browser) then you need to refresh the view in Eclipse after you renamed the file.
 
Siri Naray
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Koen
Yes the cases are all matching. Still trying to figure out.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IDEs are wonderful things.

Except when you don't know what you're doing. In that respect, they're rather like chainsaws. If you don't hold them right...

The "Resource unavailable" message is not the same as (404) "Resource not found". I think what actually happened is that the JSP does not compile and therefore isn't available even though the resource URL does correctly point to the JSP resource itself.

This is where the IDE can make things worse. I've already railed against the offences of the WTP Tomcat manager, so I'll skip that, but to make a long story short, Eclipse is probably kicking around stale data.

The simplest way to diagnose and repair that is to remove Eclipse from the equation. Ideally, that means from the build point on (which is one reason why all my projects can be built via Ant or Maven without using an IDE at all). Failing that, however, build the WAR with Eclipse, shut down Eclipse, delete the files from the TOMCAT_HOME/work and TOMCAT_HOME/temp directories and delete the webapp's WAR file and exploded WAR directory from TOMCAT_HOME/webapps. Deletion of the exploded WAR is critical since Tomcat will use that even if the WAR file itself is newer.

Once you've done all of the above, launch Tomcat stand-alone. request the JSP, and see what happens.
 
Siri Naray
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Tim
thank you for teh reply. I did work on couple of other JSTL program and they are working fine. Dont know why this one is acting so differently. I did what you said but still the same error.
 
reply
    Bookmark Topic Watch Topic
  • New Topic