Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-636

The name "" is not legal for JDOM/XML namespaces exception in Spring-WS


    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Works as Designed
    • Affects Version/s: 1.5.6, 1.5.9
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      Unix, Windows, JVM 1.6.x, Weblogic 10.3


      This problem is similar to the one raised at https://jira.springframework.org/browse/SWS-497. However, I do believe that the issue is caused by Spring, not JDOM. Since I couldn't track the problem down in the Spring-WS source code, my opinion is based on the outcome of a 'trial and error' exercise.

      Here is the exception I'm getting:

      org.jdom.IllegalNameException: The name "" is not legal for JDOM/XML namespaces: Namespace URIs must be non-null and non-empty Strings.
              at org.jdom.Namespace.getNamespace(Namespace.java:162)
              at org.jdom.input.SAXHandler.startPrefixMapping(SAXHandler.java:498)
              at org.xml.sax.helpers.XMLFilterImpl.startPrefixMapping(XMLFilterImpl.java:490)
              at org.jdom.transform.JDOMResult$DocumentBuilder.startPrefixMapping(JDOMResult.java:529)
              at weblogic.apache.xalan.transformer.TransformerIdentityImpl.startPrefixMapping(TransformerIdentityImpl.java:939)
              at weblogic.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:358)
              at weblogic.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:190)
              at weblogic.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:335)
              at org.springframework.xml.transform.TransformerObjectSupport.transform(TransformerObjectSupport.java:71)

      I carried out a number of tests in the Weblogic 10.3 container against a Spring-WS SOAP service. I initially thought that the problem is caused by the javax.xml.soap.MessageFactory setting in JVM. However, I couldn't get satisfactory results after experimenting with various implementation.

      Fortunately, I discovered that the problem can be fixed by declaring the following Spring bean amongst the others in my application:

      <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
          <property name="messageFactory">
              <bean class="weblogic.xml.saaj.MessageFactoryImpl"/>

      Moreover, when I swap the configuration with an alternative one, for example:

      <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
          <property name="messageFactory">
              <bean class="com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl"/>

      ... the problem is apparent again. It is happening regardless of having JVM started with -Djavax.xml.soap.MessageFactory=weblogic.xml.saaj.MessageFactoryImpl. Changing the javax.xml.transform.TransformerFactory JVM setting doesn't help either.

      The evidence I presented above clearly indicates that Spring is doing something under the hood that somehow affects the JDOM functionality.

      I replicated the problem in Spring-WS 1.5.6 and 1.5.9 and haven't tested the versions in between.


          Issue Links



              • Assignee:
                arjen.poutsma Arjen Poutsma
                rzacz Robert Z.
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created: