Soap over Jms - Error: Insufficient configuration for Conduit
ale2011 Jan 8, 2012 8:13 PMHello,
I've been following this documentation for SOAP over JMS: https://docs.jboss.org/author/display/JBWS/SOAP+over+JMS
I'm able to get the server to work but after when I implemented the client, I tried to run it and I have this error:
Jan 8, 2012 7:51:05 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL INFO: Creating Service {http://soapjms.rd.nsrr.swim.faa.gov/}SoapJmsWeatherImpl from WSDL: <PATH_TO_WSDL> Invoking getForecast... Jan 8, 2012 7:51:10 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging WARNING: Interceptor for {http://soapjms.rd.nsrr.swim.faa.gov/}SoapJmsWeatherImpl#{http://soapjms.rd.nsrr.swim.faa.gov/}GetForecast has thrown exception, unwinding now org.apache.cxf.configuration.ConfigurationException: Insufficient configuration for Conduit. Did you configure a <jms:conduit name="{http://soapjms.rd.nsrr.swim.faa.gov/}SoapJmsWeatherImplPort.jms-conduit"> and set the jndiConnectionFactoryName ? at org.apache.cxf.transport.jms.JMSConfiguration.ensureProperlyConfigured(JMSConfiguration.java:106) at org.apache.cxf.transport.jms.JMSConduit.prepare(JMSConduit.java:102) at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:484) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:414) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:317) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:269) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) at $Proxy25.getForecast(Unknown Source) at gov.faa.swim.nsrr.rd.soapjms.Main.main(Main.java:49) Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Insufficient configuration for Conduit. Did you configure a <jms:conduit name="{http://soapjms.rd.nsrr.swim.faa.gov/}SoapJmsWeatherImplPort.jms-conduit"> and set the jndiConnectionFactoryName ? at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146) at $Proxy25.getForecast(Unknown Source) at gov.faa.swim.nsrr.rd.soapjms.Main.main(Main.java:49) Caused by: org.apache.cxf.configuration.ConfigurationException: Insufficient configuration for Conduit. Did you configure a <jms:conduit name="{http://soapjms.rd.nsrr.swim.faa.gov/}SoapJmsWeatherImplPort.jms-conduit"> and set the jndiConnectionFactoryName ? at org.apache.cxf.transport.jms.JMSConfiguration.ensureProperlyConfigured(JMSConfiguration.java:106) at org.apache.cxf.transport.jms.JMSConduit.prepare(JMSConduit.java:102) at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:484) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:414) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:317) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:269) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) ... 2 more
I have created a cxf.xml file that contains the jms:conduit and jms:destination (below), and put it in the /WEB-INF/ directory of my server .WAR file. But somehow JBoss does not read that file.
... <jms:conduit name="{http://soapjms.rd.nsrr.swim.faa.gov/}SoapJmsWeatherImplPort.jms-conduit"> <jms:address destinationStyle="queue" jndiConnectionFactoryName="java:activemq/QueueConnectionFactory" jndiDestinationName="java:activemq/queue/GetForecastRequestQueue" jndiReplyDestinationName="java:activemq/queue/GetForecastResponseQueue"> <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory" /> <jms:JMSNamingProperty name="java.naming.provider.url" value="vm://localhost" /> </jms:address> </jms:conduit> <jms:destination name="{http://soapjms.rd.nsrr.swim.faa.gov/}SoapJmsWeatherImplPort.jms-destination"> <jms:address destinationStyle="queue" jndiConnectionFactoryName="java:activemq/QueueConnectionFactory" jndiDestinationName="java:activemq/queue/GetForecastRequestQueue" jndiReplyDestinationName="java:activemq/queue/GetForecastResponseQueue"> <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory" /> <jms:JMSNamingProperty name="java.naming.provider.url" value="vm://localhost" /> </jms:address> </jms:destination> ...
Here is my client:
package gov.faa.swim.nsrr.rd.soapjms; import java.net.URL; import javax.xml.namespace.QName; import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; import org.apache.cxf.interceptor.LoggingInInterceptor; import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; public final class Main { private static final QName SERVICE_NAME = new QName("http://soapjms.rd.nsrr.swim.faa.gov/", "SoapJmsWeatherImpl"); private Main() { } public static void main(String args[]) throws Exception { URL wsdlURL = SoapJmsWeatherImpl.WSDL_LOCATION; Bus bus = BusFactory.newInstance().createBus(); BusFactory.setThreadDefaultBus(bus); try { SoapJmsWeatherImpl service = new SoapJmsWeatherImpl(wsdlURL, SERVICE_NAME); System.out.println("===== Interacting with JMS endpoint ======"); SoapJmsWeatherImplPortType proxy = (SoapJmsWeatherImplPortType) service.getSoapJmsWeatherImplPort(); System.out.println("\nInvoking getForecast..."); proxy.getForecast("Philadelphia"); } finally { bus.shutdown(true); } System.exit(0); } }
Could someone guide me to the right direction to get this to work? Thanks.