How to config the queue name
ale2011 Dec 27, 2011 9:06 AMHello,
I've been trying to deploy a service with 2 queues: GetForecastRequestQueue and GetForecastResponseQueue. But I'm lost now and I'd really appreciate if someone could help me out with this problem.
I have JBOSS AS 6 , with ActiveMQ integrated. (I've removed the HornetQ because I'll be using activemq instead of it).
I created 2 queues in the activemq-jms-ds.xml . I basically copied and pasted the inbound queue that was originally there, and replace the name.
..... <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.queue:name=GetForecastRequestQueue"> <attribute name="JNDIName">activemq/queue/GetForecastRequestQueue</attribute> <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra.rar'</depends> <attribute name="Type">javax.jms.Queue</attribute> <attribute name="Properties">PhysicalName=GetForecastRequestQueue</attribute> </mbean> <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.queue:name=GetForecastResponseQueue"> <attribute name="JNDIName">activemq/queue/GetForecastResponseQueue</attribute> <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra.rar'</depends> <attribute name="Type">javax.jms.Queue</attribute> <attribute name="Properties">PhysicalName=GetForecastResponseQueue</attribute> </mbean> .....
In my .war file, I have the wsdl and cxf.xml file that contain information about the queue as follow:
cxf.xml
.... <jms:conduit name="{http://soapjms.rd.nsrr.swim.faa.gov/}SoapJmsWeatherImplPort.jms-conduit"> <jms:address destinationStyle="queue" jndiConnectionFactoryName="java:activemq/QueueConnectionFactory" jndiDestinationName="activemq/queue/GetForecastRequestQueue" jndiReplyDestinationName="activemq/queue/GetForecastResponseQueue"> <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory" /> <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://192.168.10.64:61616" /> </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="activemq/queue/GetForecastResponseQueue" jndiReplyDestinationName="activemq/queue/GetForecastResponseQueue"> <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory" /> <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://192.168.10.64:61616" /> </jms:address> </jms:destination> ...
soapjmsweatherforecast.wsdl
... <wsdl:service> ... <wsdl:port name="SoapJmsWeatherImplPort" binding="tns:SoapJmsWeatherImplServiceSoapBinding"> <soap:address location= "jms:queue:GetForecastRequestQueue?replyToName=GetForecastResponseQueue"/> </wsdl:port> </wsdl:service> ...
When I deployed this service, I get this error
DEPLOYMENTS IN ERROR: Deployment "vfs:///C:/jboss/jboss-6.0.0.Final/server/default/deploy/SoapJmsWeatherForecast.war" is in error due to the following reason(s): javax.naming.NameNotFoundException: activemq/queue/GetForecastResponseQueue
I don't understand why I got that error. The log shows that the queue bound at that address "activemq/queue/GetForecastResponseQueue" so how come it did not regconize the queue when I deployed it? I've tried just the queue name "GetForecastRequestQueue" and it also did not work.
I looked at the Global JNDI namespace, it shows the 2 queues are under activemq/queue/ ..
+- activemq (class: org.jnp.interfaces.NamingContext)
| +- queue (class: org.jnp.interfaces.NamingContext)
| | +- GetForecastRequestQueue (class: org.apache.activemq.command.ActiveMQQueue)
| | +- GetForecastResponseQueue (class: org.apache.activemq.command.ActiveMQQueue)
+- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
What should I do to get to those 2 queues? Thanks a lot.