4 Replies Latest reply on May 17, 2011 5:10 AM by nickarls

    jboss-web context-root not honored

    nickarls

      I have a WAR with a jboss-web.xml in WEB-INF like

       

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

      <jboss-web>

                <context-root>/Foo</context-root>

      </jboss-web>

       

      but for some reason the context root still defaults to the war file name. Any pointers on where to start looking? AS 6 final...

        • 1. jboss-web context-root not honored
          jaikiran

          Is that .war part of a .ear? Or is it a standalone .war? Can you post the console logs when your application is deploying?

          • 2. jboss-web context-root not honored
            nickarls

            Standalone .WAR. The log is really boring, mostly beans/webservices/jndi bindings and jpa stuff init but the stripped-down version is like

             

            11:51:59,475 INFO  [JBossASKernel] Created KernelDeployment for: OSTi-3.0.0-SNAPSHOT.war

            11:52:18,771 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}

            11:52:20,090 INFO  [TomcatDeployment] deploy, ctxPath=/

            11:52:28 @ INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/OSTi-3.0.0-SNAPSHOT

            11:52:28 @ INFO  [org.jboss.seam.faces.config.FacesServletInitializer] Auto-registering FacesServlet with mappings: [/faces/*, *.jsf, *.faces]

            11:52:33 @ INFO  [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080

            11:52:33 @ INFO  [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009

            11:52:33 @ INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.Final "Neo"] Started in 1m:19s:989ms

             

            Is there some log level that shows if jboss-web.xml is found and processed?

            • 3. jboss-web context-root not honored
              jaikiran

              The easiest way to check would be to add some invalid content to jboss-web.xml to see if it's being picked up. The cleaner approach would be to enable TRACE level logging on org.jboss package when your application is being deployed (I would have told you the specific class or package name for finer log control, but currently I have dug deep into AS7 code and just too lazy to fire up my AS6 workspace).

               

              You can also post the output of

               

              jar -tf OSTi-3.0.0-SNAPSHOT.war

               

              That output might also help to figure out whether the jboss-web.xml is indeed there and is at the right place.

              • 4. jboss-web context-root not honored
                nickarls

                WEB-INF/jboss-web.xml

                 

                and changing the tag to <xcontext-root> causes it to barf