Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6212283

org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • xml
    • b61
    • x86
    • linux

      FULL PRODUCT VERSION :
      java version "1.4.2_03"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
      Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Linux nx0145.nextenso.alcatel.fr 2.4.19-16mdk #1 Fri Sep 20 18:15:05 CEST 2002 i686 unknown unknown GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      When using xalan 2.6.0 as endorsed library, I get a SOAPException when parsing a SOAP body element that has a namespace but no prefix (<MyTag xmlns="http://foo.com/schema"/>) which i believe is a correct syntax.

      I have seen bugs #4967753, #4968635 and #4966232 but i believe this is yet different.

      i believe the problem is caused by xalan's TransformerIdentityImpl forcing http://xml.org/sax/features/namespace-prefixes feature to true and i'm also submitting the problem to xalan (bug #28430).

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      run the test program below:
      1 - using jdk1.4.2 and jwsdp -> it works
      2 - setting the java.endorsed.lib system property to use xalan library latest version (2.6.0), overriding the one provided with the JDK -> it crashes

      ACTUAL -
      Exception stack trace when using xalan 2.6.0

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.xml.soap.*;
      import java.io.*;

      public class SoapTest
      {
      public static void main( String arg[] )
      throws Exception
      {
      MessageFactory mfactory = MessageFactory.newInstance();
      SOAPFactory sfactory = SOAPFactory.newInstance();

      SOAPMessage orig = mfactory.createMessage();
      SOAPBody body = orig.getSOAPBody();
      body.addBodyElement( sfactory.createName( "MyTag", null, "http://foo.com/schema" ) ); //purposely set no namespace prefix
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      orig.writeTo( baos );
      orig.writeTo( System.out );
      SOAPMessage parsed = mfactory.createMessage( orig.getMimeHeaders(), new ByteArrayInputStream( baos.toByteArray() ) );
      parsed.getSOAPBody();
      System.out.println( "done." );
      }
      }
      ---------- END SOURCE ----------
      ###@###.### 2004-12-23 19:14:41 GMT

            jsuttorsunw Jeff Suttor (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: