7 Replies Latest reply on Feb 24, 2003 9:00 AM by ehenne

    jboss-web.xml and res-url

      In the JBoss 3.0 book I found at the bookstore, there's a mention of URL resources defined using the "res-url" tag. It's not anywhere to be found in the for-pay documentation. I would have just bought the book, but I already paid for the docs, soo ;)

      Is there an updated DTD to show me how to use this correctly? Someone out there must know about it.

      Steve

        • 1. Re: jboss-web.xml and res-url
          ehenne

          This is a documentation bug about jboss-web.xml. It is in "The jboss-web.xml ENC Elements" as well as in the appendix "The JBoss server jboss-web.xml descriptor DTD":

          The <resource-ref> element has the same form as in jboss.xml, especially when using an URL (type is "java.net.URL") you have to use <res-url> instead of <jndi-name>. I had to look up this in the jboss source.

          I have not found an updated DTD.

          Elmar

          • 2. Re: jboss-web.xml and res-url

            So is this the correct format for jboss-web.xml? I grabbed this from the DTD for jboss.xml. I just want to make sure, but I'll test it anyways.

            <resource-manager>
            <res-name />
            <res-url />
            </resource-manager>

            • 3. Re: jboss-web.xml and res-url

              I'm getting this weird error when I try to deploy my war with the URL resource:

              10:43:16,210 INFO [MainDeployer] Starting deployment of package: file:/C:/www/j
              boss/jboss-3.0.4/server/default/deploy/skeleton.war/
              10:43:16,421 WARN [NestedThrowable] Duplicate throwable nesting of same base ty
              pe: class org.jboss.deployment.DeploymentException is assignable from: class org
              .jboss.deployment.DeploymentException

              My jboss-web.xml has the following:

              <resource-ref>
              <res-name>url/Zope</res-name>
              <res-url>http://dev-zope-knox01:8080/</res-url>
              </resource-ref>

              • 4. Re: jboss-web.xml and res-url

                Which package is this in? Looking at the source now.

                • 5. Re: jboss-web.xml and res-url
                  ehenne

                  Hi,

                  here is an example form my jboss-web.xml, I think the res-type entry is required because they look for res-url if the type is java.net.URL:
                  [pre] <resource-ref>
                  <res-ref-name>url/CatalogDAOSQLURL</res-ref-name>
                  <res-type>java.net.URL</res-type>
                  <res-url>http://localhost:8080/petstore/CatalogDAOSQL.xml</res-url>
                  </resource-ref>
                  [/pre]The relevant source is in org.jboss.metadata.ResourceRefMetaData.importEjbJarXml()

                  This method is used for ejb-jar, jboss and jboss-web.

                  I hope this helps,
                  Elmar

                  • 6. Re: jboss-web.xml and res-url

                    > [/pre]The relevant source is in
                    > org.jboss.metadata.ResourceRefMetaData.importEjbJar
                    > ml()


                    Okay, that's being executed, but that's for web.xml. The corresponding method call for jboss-web.xml is:

                    importJbossXml()

                    I added some debug logs to this class and this method isn't being called at all.

                    Steve

                    • 7. Re: jboss-web.xml and res-url
                      ehenne

                      Hi Steve,

                      yes you are right, I looked at the wrong header, importJbossXml has the relevant code for parsing res-url.

                      "jboss-web.xml" is loaded via importJBossWebXml which in turn calls importJbossXml for the resource-ref entries. I just looked at the sources, so I am not totally sure if it is actually called, but using res-url inside jboss-web.xml worked for me.

                      Elmar