5 Replies Latest reply on Nov 14, 2003 6:27 PM by jonlee

    Deployment Exception

    jtoynbee

      When deploying a war (from a BEA server) I get a deployment exception:

      org.jboss.deployment.DeploymentException: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)"

      The above would imply that I have a dtd with a bad web-app.

      Attached find my dtd. Any help would be appreciated.

      Thanks.

        • 1. Re: Deployment Exception
          jonlee

          Do you have any other declarations before this? Normally, the parser expects well formed XML. Try this at the start of the deployment descriptor:

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

          Don't have any empty lines at the start of the file before the <?xml ... tag.

          Otherwise it looks ok in terms of elements.

          • 2. Re: Deployment Exception
            jtoynbee

            Thanks for your response. This is my first line:

            <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
            " "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">^M

            I can't see anything wrong with it. The exception indicates an unexpected token (keyword). Either BEA or JBoss are not conforming to published spec because the same dtd works under Weblogic 7.0.

            Thanks for anymore help!

            • 3. Re: Deployment Exception
              jtoynbee

              After adding:
              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

              I get the same exception. It's driving me batty!

              • 4. Re: Deployment Exception
                jtoynbee

                OK. Here are the elements that cause an exception:

                <session-config>
                <session-timeout>120</session-timeout>
                </session-config>

                If I remove the above the app deploys. Can anyone tell me if this is a JBoss problem?

                • 5. Re: Deployment Exception
                  jonlee

                  Also missed that the first time around. Look at the DTD complaint. session-config must appear after the servlet-mapping. Move it there and hopefully you will have a fully compliant deployment descriptor.