1 Reply Latest reply: Aug 13, 2008 11:40 AM by lall lall RSS

    The requested resource is not available.

    Riza Nugraha Newbie

      Hi all,

      Pls help me to find what's wrong with my app. I was so frustated deploying my simple servlet on JBoss. It works fine in Resin. It seems it cannot recognize my servlet mapping.

      I got this error:

      type Status report
      message /sum/servlet/SumServlet
      description The requested resource (/sum/servlet/SumServlet) is not available.


      Here's my web.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
      <web-app>
       <servlet>
       <servlet-name>SumServlet</servlet-name>
       <servlet-class>example.sum.SumServlet</servlet-class>
       </servlet>
       <servlet-mapping>
       <servlet-name>SumServlet</servlet-name>
       <url-pattern>/execute</url-pattern>
       </servlet-mapping>
      </web-app>


      FYI I'm using JBoss 4.0.1RC2. All replies are appreciated.


        • 1. Re: The requested resource is not available.
          lall lall Newbie

          Hi rnugraha,

          It might be a little late, but this is how it worked for me:

          <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
          
           <servlet>
           <servlet-name>GatewayServlet</servlet-name>
           <servlet-class>com.web.GatewayServlet</servlet-class>
           </servlet>
          
           <servlet-mapping>
           <servlet-name>GatewayServlet</servlet-name>
           <url-pattern>/*</url-pattern> <!-- !!! -->
           </servlet-mapping>
          </web-app>
          
          


          Calling the Servlet after deployment with a .war named GatewayServlet.war:

          http://localhost:8080/GatewayServlet

          If you need a different context root than here GatewayServlet, then you
          need a jboss-web.xml with the following content:

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
          <jboss-web>
           <context-root>/gateway</context-root>
          </jboss-web>
          


          The browser URL is then:

          http://localhost:8080/gateway

          Can you confirm that?


          There are supposed to be people saying it is never to late! ;-)