1 Reply Latest reply on Sep 13, 2005 4:53 AM by coolerking

    JBoss 4.0.2 web module deployment query

    coolerking

      Hi,

      I'm trying to write a simple appln consisting of a JSP page and
      servlet, combine that into a .war (packed into a .ear) and drop it in
      the D:\JBoss\jboss402\server\default\deploy directory.

      The JSP page is found, but the Servlet is not.

      I have included my steps below:

      -------------------------------------------------------
      1) JSP and Servlet related files:

      root/example2/index.jsp
      root/example2/WEB-INF/web.xml
      root/example2/WEB_INF/classes/HelloWorld.class
      - combine example2/*.* ---> example2.war

      2) application.xml file

      root/META-INF/application.xml
      -combine /META-INF/*.* + example2.war --> example2.ear

      3) Deploy .ear file

      D:\JBoss\jboss402\server\default\deploy\example2.ear

      4) web.xml file

      <web-app>

      <servlet-name>HelloWorld</servlet-name>
      <servlet-class>HelloWorld</servlet-class>

      <servlet-mapping>
      <url-pattern>/servlet/HelloWorld</url-pattern>
      <servlet-name>HelloWorld</servlet-name>
      </servlet-mapping>
      </web-app>

      5) application.xml file

      <?xml version="1.0" encoding="ISO-8859-1"?>

      <display-name>Example 2 </display-name>


      <web-uri>example2.war</web-uri>
      <context-root>/example2</context-root>




      6) JSP page found at:
      http://localhost:8080/example2/example2/

      7) Servlet NOT found at
      http://localhost:8080/example2/example2/HelloWorld

      The JSP link to servlet is : a href="servlet/HelloWorld", but Servlet is not found at: http://localhost:8080/example2/example2/servlet/HelloWorld

      ERROR Message:
      type Status report
      message /example2/example2/servlet/HelloWorld
      description The requested resource
      (/example2/example2/servlet/HelloWorld) is not available.
      -------------------------------------------------------------
      Questions:

      1) For the JSP page the url is:
      http://localhost:8080/example2/example2/

      I'm guessing the first "example2" in the URL refers to "example2.ear"
      and next to "example2.war", is that correct?.

      2) why can't it find the Servlet?

      3) Is there ever any need to set the classpath for TOMCAT when it comes
      embedded in JBoss? If yes, point it to where?

      Thanks for any help,
      Rohit.