In NetBeans we copied com.sun.servicetag sources to NetBeans modules to support registration on older JDK versions. This problem happens on JDK 6u1 but not on JDK 6u3 and JDK 5.0u13.
Exception call stack is attached.
Comments
EVALUATION
This is a manifestation of the bug: 6531160, it seems to be a good
practice to add the namesSpaceaware(true) as pointed out in the
sample here: http://java.sun.com/webservices/docs/2.0/jaxp/samples.html
21-12-2007
SUGGESTED FIX
*** /tmp/geta8339 Fri Dec 21 09:35:02 2007
--- RegistrationDocument.java Fri Dec 21 09:33:19 2007
***************
*** 113,118 ****
--- 113,119 ----
// initialize a document from an input stream
private static Document initializeDocument(InputStream in) throws IOException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
try {
// XML schema for validation
SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
***************
*** 140,145 ****
--- 141,147 ----
// initialize a new document for the registration data
private static Document initializeDocument() throws IOException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
try {
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.newDocument();
21-12-2007
WORK AROUND
According to http://weblogs.java.net/blog/spericas/archive/2007/03/xml_schema_vali.html workaround is to add 2nd line to code:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true); // Must enable namespace processing!!
DocumentBuilder parser = dbf.newDocumentBuilder();