2 Replies Latest reply on Sep 28, 2006 7:01 AM by kevinstembridge

    DTD lookup behind firewall

      Hi folks,
      How can I ask JBoss to look for a local copy of a DTD rather than going to the web? We're behind a firewall, so when JBoss starts up and tries to deploy an EAR file that contains some Spring bean definition files, it complains about not being able to find the spring-beans DTD.

      This DTD is included in spring.jar, which we deploy inside the EAR, so I was wondering how to cause JBoss to look there first.

      Any help is greatly appreciated.

      Cheers

        • 1. Problem (almost) solved

          After a bit more digging around, I found this page in the JBoss wiki:

          http://wiki.jboss.org/wiki/Wiki.jsp?page=XMLEntitySchemaResolution

          So JBoss versions 4.0.3 and above have an MBean that we can use to configure an entity resolver. However, when I created a service descriptor with the following content....

           <server>
           <mbean code="org.jboss.services.xml.JBossEntityResolverMgr" name="jboss.xml:service=JBossEntityResolverMgr">
           <attribute name="WarnOnNonFileURLs">true</attribute>
           <attribute name="EntityMap">
           -//SPRING//DTD BEAN//EN=spring-beans.dtd
           </attribute>
           </mbean>
           </server>
          
          


          ... after starting JBoss, I still get the error where the server is trying to connect to the web to retrieve the spring-beans.dtd and when I look at the JMX console page for the JBossEntityResolverMgr it shows that the above EntityMap attribute of the MBean has been parsed like so:

          -//SPRING//DTD=BEAN//EN=spring-beans.dtd

          Note that the space in the PublicId has been converted to an equals sign. I've tried using quotes around the publicId and also around the whole string but this just causes even more problems.

          Can anybody give me some pointers on what format to use so the the space is correctly interpreted? Failing that, does anybody know what class is responsible for parsing the service descriptors?

          Cheers,
          Kevin

          • 2. Solved

            The contents of the EntityMap attribute is expected to be in java.util.Properties format, so the whitespace in the key needs to be escaped. This is the complete service.xml file that works.

             <server>
             <mbean code="org.jboss.services.xml.JBossEntityResolverMgr" name="jboss.xml:service=JBossEntityResolverMgr">
             <attribute name="WarnOnNonFileURLs">true</attribute>
             <attribute name="EntityMap">
             -//SPRING//DTD\ BEAN//EN=org/springframework/beans/factory/xml/spring-beans.dtd
             </attribute>
             </mbean>
             </server>
            



            Thanks to David Boeren from JBoss for finding the solution to this problem.