Back Forum Reply New

NAMESPACE_ERR: An attempt is made to create or change an object

Hi,

When a web client is invoking my web service then the server returns the following exception:

Error  org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
15.apr.2008 10:00:01 com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
SEVERE: SAAJ0511: Unable to create envelope from given source

According to the spring-ws release note, bug 275 is about the same thing, but is fixed.

The application is running at Tomcat 5.5.25, spring-ws 1.5.0 and jdk1.5.0_01. The same error occures when I'm deploying at JBoss 4.4.2 GA (I have tried to copy the xml and saaj apis to the server endorsed catalogues)

Please, can someone help

Unfortunately, this exception is rather generic, and can have a wide range of causes. What kind of endpoint are you using? Did you bundle Xerces 2.8.1 and Xalan 2.7.0?

The problem was caused by jar conflicts. I had followed all the advices about the SAAJ and XML libs, but the problem still remained. My solution was to remove the jbossws.sar from the Jboss deploy directory. The jbossws was loading old xalan and xerses jars in addition to JBoss implementations of the SAAJ.

.apache.xalan.internal.xsltc.trax.Trans  formerImpl.transform(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.Trans  formerImpl.transform(Unknown Source)
at org..ws.client.core.WebServiceTempl  ate$5.doWithMessage(WebServiceTemplate.java:459)
at org..ws.client.core.WebServiceTempl  ate.doSendAndReceive(WebServiceTemplate.java:535)
... 55 more
Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
at com.sun.org.apache.xerces.internal.dom.CoreDocumen  tImpl.checkNamespaceWF(Unknown Source)
at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.  setName(Unknown Source)
at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.  lt;initgt;(Unknown Source)
at com.sun.org.apache.xerces.internal.dom.CoreDocumen  tImpl.createAttributeNS(Unknown Source)
at com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl.c  reateAttributeNS(SOAPDocumentImpl.java:161)
at com.sun.org.apache.xerces.internal.dom.ElementImpl  .setAttributeNS(Unknown Source)
at com.sun.xml.messaging.saaj.soap.impl.ElementImpl.s  etAttributeNS(ElementImpl.java:1213)
at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2D  OM.startElement(Unknown Source)
at com.sun.org.apache.xml.internal.serializer.ToXMLSA  XHandler.closeStartTag(Unknown Source)
at com.sun.org.apache.xml.internal.serializer.ToXMLSA  XHandler.characters(Unknown Source)
at org.jdom.output.SAXOutputter.characters(SAXOutputt  er.java:1155)
at org.jdom.output.SAXOutputter.elementContent(SAXOut  putter.java:1100)
at org.jdom.output.SAXOutputter.elementContent(SAXOut  putter.java:1067)
at org.jdom.output.SAXOutputter.element(SAXOutputter.  java:897)
at org.jdom.output.SAXOutputter.elementContent(SAXOut  putter.java:1093)
at org.jdom.output.SAXOutputter.elementContent(SAXOut  putter.java:1067)
at org.jdom.output.SAXOutputter.element(SAXOutputter.  java:897)
at org.jdom.output.SAXOutputter.output(SAXOutputter.j  ava:621)
at org.jdom.transform.JDOMSource$DocumentReader.parse  (JDOMSource.java:476)
at com.sun.org.apache.xalan.internal.xsltc.trax.Trans  formerImpl.transformIdentity(Unknown Source)
¥
Back Forum Reply New