When I try to move this junit test/code into the main product project I keep getting the exceptions below. The difference between the two projects, is that obviously there are a load of extra jars added to the classpath of the main project - mule, cxf, spring jars etc. So even though the code in the junit test does not require any of these jars there seems to be some jar loading conflict happening (which I cant seem to track down)? (Again when I run this code in a project with just the jvm6 and junit jars it works fine)
Thanks in advance for any help.
---------------------------------------------
The imports in my junit test:
---------------------------------------------
import javax.xml.ws.WebServiceRef;
import org.junit.Assert;
import org.junit.Test;
--------------------
Exceptions:
--------------------
javax.xml.ws.soap.SOAPFaultException: No conduit initiator was found for the namespace http://schemas.xmlsoap.org/soap/http.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
..
...
Caused by: org.apache.cxf.interceptor.Fault: No conduit initiator was found for the namespace http://schemas.xmlsoap.org/soap/http.
at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:89)
at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:61)
at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:472)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:293)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
... 25 more
Caused by: org.apache.cxf.BusException: No conduit initiator was found for the namespace http://schemas.xmlsoap.org/soap/http.
at org.apache.cxf.transport.ConduitInitiatorManagerImpl.getConduitInitiator(ConduitInitiatorManagerImpl.java:111)
at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:70)
... 31 more
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Thanks for your reply.
Here is a list of the jars that are added to the classpath, one of these is causing the problem:
junit-4.4.jar
cxf-rt-transports-local-2.1.2.jar
cxf-api-2.1.2.jar
cxf-tools-common-2.1.2.jar
cxf-rt-frontend-jaxws-2.1.2.jar
cxf-common-utilities-2.1.2.jar
cxf-rt-core-2.1.2.jar
wsdl4j-1.6.2.jar
xml-resolver-1.2.jar
cxf-rt-frontend-simple-2.1.2.jar
cxf-rt-bindings-soap-2.1.2.jar
cxf-rt-databinding-jaxb-2.1.2.jar
webservices-rt-1.1.jar
cxf-rt-ws-addr-2.1.2.jar
XmlSchema-1.4.2.jar
The junit one is the only one required by my test below, when I remove the others the code works fine.
-----------------
Junit test:
-----------------
import javax.xml.ws.WebServiceRef;
import org.junit.Assert;
import org.junit.Test;
public class PolicyValidationDetailsServiceImplMuleTest {
@WebServiceRef(wsdlLocation="http://localhost:9090/services/policyValidationDetailsService?wsdl")
static PolicyValidationDetailsServiceImplService policyValidationService;
public void runTest_PolicyNumberExists() {
//Stubs were generated using wsimport tool and the generated client code was imported into to
//the project
policyValidationService = new PolicyValidationDetailsServiceImplService();
Assert.assertNotNull(policyValidationService);
PolicyValidationDetailsServiceMessage message = new PolicyValidationDetailsServiceMessage();
message.setPolicyReference("123456789");
PolicyValidationDetailsServiceMessage returnMessage = policyValidationService.getPolicyValidationDetailsServiceImplPort().getValidationDetails(message);
Assert.assertNotNull(returnMessage);
Assert.assertEquals(new Integer(0), returnMessage.getStatus().getCode());
Assert.assertEquals("AgentCode1", returnMessage.getAgentCode());
}
@Test
public void testWebservice() {
PolicyValidationDetailsServiceImplMuleTest test = new PolicyValidationDetailsServiceImplMuleTest();
test.runTest_PolicyNumberExists();
}
The line below is what is throwing the exception in my test only when the jars above are added to the classpath (That object was generated using the wsimport tool)
PolicyValidationDetailsServiceMessage returnMessage = policyValidationService.getPolicyValidationDetailsServiceImplPort().getValidationDetails(message);
Thanks Andrew,
I haven't tried that yet but will do now. Quick question might there be any problems using these newer jars with mule 2.2.1. Our project is tied to that version of mule.