org.jdom.IllegalNameException: The name "" is not legal for JDOM/XML namespaces: Namespace URIs must be non-null and non-empty Strings.

Spring JIRA | Robert Z. | 6 years ago
  1. 0

    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: {noformat} 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) {noformat} 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: {code:xml} <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"> <property name="messageFactory"> <bean class="weblogic.xml.saaj.MessageFactoryImpl"/> </property> </bean> {code} Moreover, when I swap the configuration with an alternative one, for example: {code:xml} <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"/> </property> </bean> {code} ... 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.

    Spring JIRA | 6 years ago | Robert Z.
    org.jdom.IllegalNameException: The name "" is not legal for JDOM/XML namespaces: Namespace URIs must be non-null and non-empty Strings.
  2. 0

    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: {noformat} 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) {noformat} 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: {code:xml} <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"> <property name="messageFactory"> <bean class="weblogic.xml.saaj.MessageFactoryImpl"/> </property> </bean> {code} Moreover, when I swap the configuration with an alternative one, for example: {code:xml} <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"/> </property> </bean> {code} ... 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.

    Spring JIRA | 6 years ago | Robert Z.
    org.jdom.IllegalNameException: The name "" is not legal for JDOM/XML namespaces: Namespace URIs must be non-null and non-empty Strings.
  3. 0

    Intellij 15.0.2 - missing subclass / superclass symbols – JetBrains Support

    jetbrains.com | 8 months ago
    org.jdom.IllegalNameException: The name "${vlp33.nameSpace}" is not legal for JDOM/XML Namespace URIs: Namespace URIs cannot begin with a dollar sign ($).
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Intellij 15.0.2 - missing subclass / superclass symbols – JetBrains Support

    jetbrains.com | 8 months ago
    org.jdom.IllegalNameException: The name "${vlp33.nameSpace}" is not legal for JDOM/XML Namespace URIs: Namespace URIs cannot begin with a dollar sign ($).
  6. 0

    The name "" is not legal for JDOM/XML namespaces: Namespace URIs must be non-null and non-empty Strings

    Stack Overflow | 2 years ago | Boudour
    org.jdom.IllegalNameException: The name "" is not legal for JDOM/XML namespaces: Namespace URIs must be non-null and non-empty Strings.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. 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()
    2. jOpenDocument
      SAXHandler.startPrefixMapping
      1. org.jdom.Namespace.getNamespace(Namespace.java:162)
      2. org.jdom.input.SAXHandler.startPrefixMapping(SAXHandler.java:498)
      2 frames
    3. Java RT
      XMLFilterImpl.startPrefixMapping
      1. org.xml.sax.helpers.XMLFilterImpl.startPrefixMapping(XMLFilterImpl.java:490)
      1 frame
    4. jOpenDocument
      JDOMResult$DocumentBuilder.startPrefixMapping
      1. org.jdom.transform.JDOMResult$DocumentBuilder.startPrefixMapping(JDOMResult.java:529)
      1 frame
    5. weblogic.apache.xalan
      TransformerIdentityImpl.startPrefixMapping
      1. weblogic.apache.xalan.transformer.TransformerIdentityImpl.startPrefixMapping(TransformerIdentityImpl.java:939)
      1 frame
    6. weblogic.apache.xml
      TreeWalker.traverse
      1. weblogic.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:358)
      2. weblogic.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:190)
      2 frames
    7. weblogic.apache.xalan
      TransformerIdentityImpl.transform
      1. weblogic.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:335)
      1 frame
    8. Spring XML
      TransformerObjectSupport.transform
      1. org.springframework.xml.transform.TransformerObjectSupport.transform(TransformerObjectSupport.java:71)
      1 frame