After a bit more digging around, I found this page in the JBoss wiki:
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:
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?
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.