GeeCON Prague 2014*
The moose likes Tomcat and the fly likes Error: The requested resource /webapplication_name/ is not available Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Error: The requested resource /webapplication_name/ is not available" Watch "Error: The requested resource /webapplication_name/ is not available" New topic
Author

Error: The requested resource /webapplication_name/ is not available

Romeo Ranjan
Ranch Hand

Joined: Feb 23, 2009
Posts: 95
Hi
I am trying to run a webapplication using apache tomcat 5.5.29.It says the requested resource is not available



This is what I get in the log file


This is my web.xml file


Hope the information above will help you to resolve my problem.
Thanks


SCJP 6.0
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

Wow! You've got a bunch of issues. Some that I can see off the top of my head:
  • Remove servlet-api.jar from WEB-INF/lib.
  • Same for the JSP jar if it is there.
  • Remove all the tld files that were extracted from the JSTL. Remove their declarations from the deployment descriptor.


  • The API jars will cause your app to not work. The JSTL TLD files will be found in the jar files for the JSTL.

    You are also including old JSTL libraries, the -rt libraries are for Tomcat 4.8


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    Romeo Ranjan
    Ranch Hand

    Joined: Feb 23, 2009
    Posts: 95
    Bear Bibeault wrote:
  • Remove servlet-api.jar from WEB-INF/lib.
  • -removed
  • Same for the JSP jar if it is there.
  • -none was there
  • Remove all the tld files that were extracted from the JSTL. Remove their declarations from the deployment descriptor.-removed



  • "Remove all the tld files that were extracted from the JSTL"-can you elaborate on this part?

    Since I am getting the same error.
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61315
        
      66

    You have a bunch of declaration for JSTL TLDs in your deployment descriptor such as:
    These all need to be removed; and if the .tld files exist in WEB-INF as declared, they must all be removed as well. The only thing you have to do to use the JSTL is to find the right jar files for the version you are using (JSTL 1.1 for Tomcat 5) and drop them in WEB-INF/lib. That's it. No TLDs, no goop in web.xml.

    I'm not guaranteeing that cleaning things up will cause your app to work, but it sure as heck isn't going to with all these erroneous declaration gumming up the plumbing.
    Tim Holloway
    Saloon Keeper

    Joined: Jun 25, 2001
    Posts: 16101
        
      21

    Romeo, I'm guessing that the documentation you got your samples from is really, really old. Explicit definition of TLDs in web.xml is no longer the "way to do it". For quite a few years now, it's been possible for tag library developers to place their TLD files in the jar that defines the tag library itself. Which is much tidier and easier to install.


    Customer surveys are for companies who didn't pay proper attention to begin with.
    Romeo Ranjan
    Ranch Hand

    Joined: Feb 23, 2009
    Posts: 95
    Bear Bibeault wrote:You have a bunch of declaration for JSTL TLDs in your deployment descriptor such as:
    These all need to be removed; and if the .tld files exist in WEB-INF as declared, they must all be removed as well. The only thing you have to do to use the JSTL is to find the right jar files for the version you are using (JSTL 1.1 for Tomcat 5) and drop them in WEB-INF/lib. That's it. No TLDs, no goop in web.xml.

    I'm not guaranteeing that cleaning things up will cause your app to work, but it sure as heck isn't going to with all these erroneous declaration gumming up the plumbing.


    Hi Bear and Tim,

    Thanks for your reply. As you had suggested I had removed the .tld files (that was referenced in the web.xml file) from the WEB-INF folder. Removed the declaration in the web.xml file. But still I get the same error. Any suggestion please?

    Now this is my web.xml file


    The things is that the application works just fine (before the changes that you had suggested) when copied to the normal tomcat webapps folder and started using tomcat. Since I wanted to use the eclipse for editing purpose alone, the application does not seem to work in eclipse and I am getting the error message saying the resource is not available.
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
     
    subject: Error: The requested resource /webapplication_name/ is not available