I'm working on a mavenized java project, using Websphere 7. When the unit tests are run from the command line, using "mvn test", they all run properly. However, when they are run from eclipse, by right clicking run as junit test, a subset of them fail on web service calls because of "javax.xml.ws.WebServiceException: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted."
Caused by: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
at org.apache.xerces.dom.CoreDocumentImpl.insertBefore(Unknown Source)
at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source)
at com.ibm.ws.webservices.engine.xmlsoap.SOAPPart.appendChild(SOAPPart.java:282)
at com.sun.xml.internal.bind.marshaller.SAX2DOMEx.startElement(SAX2DOMEx.java:165)
at com.sun.xml.internal.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:147)
at com.sun.xml.internal.ws.message.AbstractMessageImpl.readAsSOAPMessage(AbstractMessageImpl.java:182)
at com.sun.xml.internal.ws.handler.SOAPMessageContextImpl.getMessage(SOAPMessageContextImpl.java:68)
I've looked at the run configurations in eclipse, and I'm sure that they are using the same (sun 1.6) JDK to run.
I printed out my classpaths in both cases, and I see that the only difference is that when I run from eclipse I have 46 ibm jars that do not exist when I run from command line. Here is a sample: 'C:\Program Files (x86)\IBM\WebSphere\AppServer\plugins\com.ibm.ws.ejbportable.jar', 'C:\Program Files (x86)\IBM\WebSphere\AppServer\plugins\com.ibm.ws.jpa.jar', 'C:\Program Files (x86)\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\dhbcore.jar', 'C:\Program Files (x86)\IBM\WebSphere\AppServer\plugins\com.ibm.ws.admin.core.jar', 'C:\Program Files (x86)\IBM\WebSphere\AppServer\installedConnectors\wmq.jmsra.rar\com.ibm.mq.headers.jar', etc. (I can print the full list if anyone finds it helpful).
Its only my suspicion that these jars are to blame for sabotaging the unit tests, and I'm open to other suggestions and can post more info as requested. I need to be able to run them from eclipse to make debugging them manageable.