2 Replies Latest reply on May 20, 2002 9:30 AM by rgjawanda

    JETTY EAR (Unknown Servlet)

    rgjawanda

      I tried to deploy and EAR FILE and I get and Unknown Servlet exception.
      In my war file I have

      WEB-INF
      web.xml
      jboss-web.xml
      classes
      ca
      husky
      xxx
      lib
      jbaan.jar (and ejb)


      I used this with tomcat and don't really know what to change. I must have a mistake.

      Here is my web.xml file

      What should I place in my <servlet-name>?
      Thanks
      Ron


      <?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-mapping>
      <servlet-name>Servlet955</servlet-name>
      <url-pattern>/Servlet955</url-pattern>
      </servlet-mapping>

      <welcome-file-list>
      <welcome-file>home.html</welcome-file>

      </welcome-file-list>

      <!-- ### EJB References (java:comp/env/ejb) -->
      <ejb-ref>
      <ejb-ref-name>Servlet955</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      ca.husky.jbaan.tisfc955_Home
      ca.husky.jbaan.tisfc955_Remote
      </ejb-ref>
      </web-app>



      ult/tmp/deploy/server/default/deploy/jbaan.ear/89.jbaan.ear^/jbaan.war!/]
      20:07:41,588 INFO [Jetty] Created temp dir /tmp/Jetty__8080___jbaan for WebApplicationContext[/jbaan,jar:njar:file:/data/swi/jboss-3.0.0RC2/server/default/tmp/deploy/server/default/deploy/jbaan.ear/89.jbaan.ear^/jbaan.war!/]
      20:07:41,591 INFO [Jetty] Extract jar:njar:file:/data/swi/jboss-3.0.0RC2/server/default/tmp/deploy/server/default/deploy/jbaan.ear/89.jbaan.ear^/jbaan.war!/ to /tmp/Jetty__8080___jbaan/webapp
      20:07:41,633 WARN [Jetty] WARNING: Configuration problem at <servlet-mapping><servlet-name>Servlet955</servlet-name><url-pattern>/Servlet955</url-pattern></servlet-mapping>
      java.lang.IllegalArgumentException: Unknown servlet: Servlet955
      at org.mortbay.jetty.servlet.ServletHandler.mapPathToServlet(ServletHandler.java:268)
      at org.mortbay.jetty.servlet.WebApplicationContext.initServletMapping(WebApplicationContext.java:884)
      at org.mortbay.jetty.servlet.WebApplicationContext.initWebXmlElement(WebApplicationContext.java:690)
      at org.jboss.jetty.JBossWebApplicationContext.initWebXmlElement(JBossWebApplicationContext.java:148)
      at org.mortbay.jetty.servlet.WebApplicationContext.initialize(WebApplicationContext.java:655)
      at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:337)
      at org.jboss.jetty.Jetty.deploy(Jetty.java:405)
      at org.jboss.jetty.JettyService.performDeploy(JettyService.java:244)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:406)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:692)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:68

        • 1. Re: JETTY EAR (Unknown Servlet)
          rgjawanda

          Oh yeah...
          jboss 3 RC2

          • 2. Re: JETTY EAR (Unknown Servlet)
            rgjawanda

            Problem solved. As usual it was my mistake.

            I found and example: in the jboss examples

            The web.xml file was incorrect.
            The mistake was that I didnt have the <servlet-class> tag. Indicating the full path to the servlet class
            New xml is this.

            sorry to bother anyone.
            Ron




            <?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-name>Servlet955</servlet-name>
            <servlet-class>ca.husky.jbaan.Servlet955</servlet-class>
            <load-on-startup>1</load-on-startup>

            <servlet-mapping>
            <servlet-name>Servlet955</servlet-name>
            <url-pattern>/Servlet955</url-pattern>
            </servlet-mapping>
            <session-config>
            <session-timeout>60</session-timeout>
            </session-config>

            <welcome-file-list>
            <welcome-file>home.html</welcome-file>
            </welcome-file-list>

            <!-- ### EJB References (java:comp/env/ejb) -->
            <ejb-ref>
            <ejb-ref-name>Servlet955</ejb-ref-name>
            <ejb-ref-type>Entity</ejb-ref-type>
            ca.husky.jbaan.tisfc955_Home
            ca.husky.jbaan.tisfc955_Remote
            </ejb-ref>
            </web-app>