david_m_jacobson
asked on
An attempt was made to insert a node where it is not permitted
I am trying to add two new variables to a Java class that was originally created with a Spring framework. I added the two variables and then I modified the mapping.xml file used for marshalling but I get the following error. What am I missing?
org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
at org.apache.axiom.om.impl.dom.NodeImpl.insertBefore(NodeImpl.java:256)
at org.apache.axiom.om.impl.dom.NodeImpl.appendChild(NodeImpl.java:235)
at org.springframework.xml.dom.DomContentHandler.startElement(DomContentHandler.java:105)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1532)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:836)
at org.springframework.oxm.castor.CastorMarshaller.marshal(CastorMarshaller.java:359)
at org.springframework.oxm.castor.CastorMarshaller.marshalSaxHandlers(CastorMarshaller.java:213)
at org.springframework.oxm.castor.CastorMarshaller.marshalDomNode(CastorMarshaller.java:207)
at org.springframework.oxm.AbstractMarshaller.marshalDomResult(AbstractMarshaller.java:190)
at org.springframework.oxm.AbstractMarshaller.marshal(AbstractMarshaller.java:86)
at org.springframework.ws.support.MarshallingUtils.marshal(MarshallingUtils.java:76)
at org.springframework.ws.client.core.WebServiceTemplate$1.doWithMessage(WebServiceTemplate.java:259)
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:395)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:256)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:244)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:236)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Venabili,
I tried changing <field name="loginId" type="java.lang.String"> to <field name="loginId" type="string">. That did not make a difference.
Then I compared the jar files in my local Tomcat/shared/lib to the jar files on another server. I was using a later version of axis2. I was using axis2-1.2 and the other server was using axis2-1.1.1. For whatever reason, when I changed my axis2 jar files, this problem went away. Hopefully this could be helpful to someone else in the future.
I tried changing <field name="loginId" type="java.lang.String"> to <field name="loginId" type="string">. That did not make a difference.
Then I compared the jar files in my local Tomcat/shared/lib to the jar files on another server. I was using a later version of axis2. I was using axis2-1.2 and the other server was using axis2-1.1.1. For whatever reason, when I changed my axis2 jar files, this problem went away. Hopefully this could be helpful to someone else in the future.
ASKER
See my final comment. The problem was solved by changing my axis2 jar files from version 1.2 to version 1.1.1. Who knows.
ASKER
Then I added loginId and transactionKey to the following files:
- WEB-INF/creditcard.wsdl
- WEB-INF/CreditCardServices
- WEB-INF/classes/mapping.xm
Finally, note that I am running this using Tomcat. I made the changes in Eclipse then created a new war file, deployed the war file in Tomcat and then ran the code.
Do you have any suggestions? Do you see something wrong with the changes I made?
Open in new window