Hi
I have a war that will use CXF with JMS transport on Spring 2.0
framework. I have followed the tutorials on the apache cxf with JMS
transport for the standalone and I have it working fine. I am now
trying to run a war but my client keeps timing out when it attempts to
receive a response from the webservice hosted on the war. I can see
that the CXF client is able to store message on the JMS (ActiveMQ)
queue.
My service name is HelloWorld.java (interface) with an implementation
HelloWorldImpl.java looking like :
@WebService (portName="HelloWorldPort",
endpointInterface="com.mycompany.app.cxf.HelloWorld")
public class HelloWorldImpl implements HelloWorld {
public String sayHi(String text) {
return "Hi, " + text;
}
}
The application context bean file, application-context-bean.xml, has
the following defined for creating the wsdl for the HelloWorldPort
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:com/mycompany/app/cxf/cxf.xml" />
<!--contains conduit information-->
<bean id="hello" class="com.mycompany.app.cxf.HelloWorldImpl" />
<jaxws:endpoint id="helloWorld" implementor="#hello"
address="/HelloWorldPort"/>
<bean id="client" class="com.mycompany.app.cxf.HelloWorld"
factory-bean="clientFactory" factory-method="create" />
<bean id="clientFactory"
class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass"
value="com.mycompany.app.cxf.HelloWorld" />
<property name="address"
value="http://localhost:8080/HelloWorldPort" />
</bean>
And then in cxf.xml, which is included in application-context-bean.xml,
I have the following defined:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://cxf.apache.org/core"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:jms="http://cxf.apache.org/transports/jms"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/core
http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schema/bindings/soap.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/jms
http://cxf.apache.org/schemas/configuration/jms.xsd
">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"
/>
<import
resource="classpath:META-INF/cxf/cxf-extension-local.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http.xml"
/>
<import resource="classpath:META-INF/cxf/cxf-extension-jms.xml"
/>
<cxf:bus>
<cxf:features>
<cxf:logging />
</cxf:features>
</cxf:bus>
<jms:conduit
name="{http://cxf.app.mycompany.com/}HelloWorldPort.jms-conduit">
<jms:address destinationStyle="queue"
jndiConnectionFactoryName="ConnectionFactory"
jndiDestinationName="dynamicQueues/test.cxf.jmstransport.queue"
connectionUserName="testUser"
connectionPassword="testPassword">
<jms:JMSNamingProperty
name="java.naming.factory.initial"
value="org.apache.activemq.jndi.ActiveMQInitialContextFactory" />
<jms:JMSNamingProperty
name="java.naming.provider.url"
value="tcp://localhost:61616" />
</jms:address>
</jms:conduit>
<jms:destination
name="{http://cxf.app.mycompany.com/}HelloWorldPort.jms-destination">
<jms:address destinationStyle="queue"
jndiConnectionFactoryName="ConnectionFactory"
jndiDestinationName="dynamicQueues/test.cxf.jmstransport.queue"
connectionUserName="testUser"
connectionPassword="testPassword">
<jms:JMSNamingProperty
name="java.naming.factory.initial"
value="org.apache.activemq.jndi.ActiveMQInitialContextFactory" />
<jms:JMSNamingProperty
name="java.naming.provider.url"
value="tcp://localhost:61616" />
</jms:address>
</jms:destination>
</beans>
I don't know why my HelloWorld.java is not able to send a response back
to the client when a message is stored on the JMS queue. In fact the
HelloWorld service is not able to pick up any message from the JMS
queue. Any examples for running a local war with CXF using JMS
transport and Spring would be helpful and appreciated.
thanks
Sonam Nepali
Salt Lake City, Utah