4 Replies Latest reply on Jan 31, 2003 2:54 PM by mickknutson

    problems deploying an war archive

    jcmeira

      When I deploy an war file with only one servlet in the web.xml file the Jboss 3.0.4 deploy ok, but when I add another servlet to the web.xml the Jboss gives the follows error:

      org.jboss.deployment.DeploymentException: Element "web-app" does not allow "serv
      let" here.; - nested throwable: (org.xml.sax.SAXParseException: Element "web-app
      " does not allow "servlet" here.)
      at org.jboss.jetty.Jetty.deploy(Jetty.java:436)
      at org.jboss.jetty.JettyService.performDeploy(JettyService.java:243)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:30
      0)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)

        • 1. Re: problems deploying an war archive

          Looks like an error in your web.xml to me. Check it with the dtd (see /doc/dtds) or attach it to your post so we can have a look.

          • 2. Re: problems deploying an war archive
            mjdinsmore

            I'm almost certain that's exactly what it is. Check your web.xml file and verify the order of the nodes in the XML document come in the right order.

            XML Spy can check your DTD for you before you deploy, or you can use some open source tools like Eclipse (http://www.eclipse.org) and a XML plug-in to do the job.

            • 3. Re: problems deploying an war archive
              jcmeira

              Thank you. The problem was that.
              I have another problem with custom tag libs. I add


              <taglib-uri>/data</taglib-uri>
              <taglib-location>/WEB-INF/tlds/taglibdatas.tld</taglib-location>


              to the web.xml and I put the TLD and classes in WEB-INF\tlds and WEB-INF\classes. When a jsp page try to access the tag library I receive the above message error.
              The reference in the jsp page is the next:
              <%@ taglib uri="/data" prefix="data"%>

              thanks in advance,
              Jose Carlos

              15:35:36,810 WARN [jbossweb] WARNING: Exception for /webcargas/ecPCargas.jsp
              org.apache.jasper.JasperException: File "/taglibdatas.tld" not found
              at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoIm
              pl.java:214)
              at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoIm
              pl.java:174)
              at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirecti
              ve(JspParseEventListener.java:1170)
              at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspP
              arseEventListener.java:765)
              at org.apache.jasper.compiler.DelegatingListener.handleDirective(Delegat
              ingListener.java:125)
              at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:255)
              at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
              at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
              at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
              at org.apache.jasper.compiler.ParserController.parse(ParserController.ja
              va:214)
              at org.apache.jasper.compiler.Compiler.compile(Compiler.java:214)
              at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
              at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessar
              y(JspServlet.java:176)
              at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspSer
              vlet.java:188)
              at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
              81)
              at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366
              )
              at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicati
              onHandler.java:293)

              • 4. Re: problems deploying an war archive
                mickknutson

                I just had this issue last week.
                I think it may have to do with commenting out certain areas of the xml file. I created a scratch xml file and just removed all the erroneous commenting that was not needed, and that seemed to fix it.