0 Replies Latest reply on May 17, 2002 11:15 AM by moraleslos

    deploying web application on Jboss and Catalina

    moraleslos

      Hi,

      I have a basic question regarding deployment of a web application to Jboss and Catalina. Do you essentially have to put the application to both Catalina's "webapps" directory and JBoss's "deploy" directory in order to run the web application?

      The reason why I'm asking is that I've been trying to deploy the sample Interest application using the Interest servlet (downloaded from JBoss) using Tomcat 4.0.3 and Jboss 3.0 RC2. First I jarred the interest application and deployed it to JBoss's deploy folder. then I put the servlet and the accompanying home.html into catalina's webapps/interest directory:
      webapps>interest>home.html
      webapps>interest>WEB-INF>web.xml
      webapps>interest>WEB-INF>jboss-web.xml
      webapps>interest>WEB-INF>classes>org>..>interest>InterestServlet.class

      Essentially I put the servlets/html/jsps into Tomcat and the ejbs/classes into JBoss.

      I think I properly configured Tomcat and Jboss to work with each other (basically put all the jars from JBoss\client to Tomcat\common\lib; took out jetty-plugin.sar from jboss\server\deploy, and edited Tomcat's setclasspath.bat file to set JAVA_OPTS=-Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.provider.url=localhost:1099 -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces).

      After editing Tomcat's server.xml file to recognize the servlet, I startup jboss and tomcat and they both startup nicely. I launch home.html which correctly brings up the Interest EJB startup page. When I click submit, I get this 500 error:
      javax.servlet.ServletException: Error instantiating servlet class org.jboss.docs.interest.InterestServlet

      because:
      java.lang.NoClassDefFoundError: org/jboss/docs/interest/Interest

      Since the servlet imports the Interest and InterestHome interfaces, tomcat could not find these in it's webapps>interest>WEB-INF>.... directory. I was thinking that Tomcat would automatically search for this through JBoss but it did not work out that way. Once I added the Interest and InterestHome classes to Tomcat, the servlet compiles fine and I get a different 500 error:
      javax.servlet.ServletException: Failed to lookup java:comp/env/ejb/Interest

      because:
      javax.naming.NamingException: Cannot create resource instance

      I think this is because Tomcat did not use jboss-web.xml which overrides web.xml's ejb-ref element.

      So after all of this, I'm not exactly sure how to deploy my web application to make it work on both Tomcat and Jboss.

      Any help to this novice would be much appreciated. thanks.

      -los