[jboss-user] [Messaging, JMS & JBossMQ] - javax.jms.InvalidDestinationException: Destination is not an
chaituu
do-not-reply at jboss.com
Tue Dec 5 06:38:26 EST 2006
followed this url and deployed new new messaging instance
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMessagingBuildInstructions
i created mdb.ear and deployed in the mesaging instance.my requirement is i am trying to lookup remote queue;
i followed below url for scoped ear for Remote Messaging Instance.
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMessagingUser_Deploying_a_scoped_MDB_container
mdb.ear was deployed with no errors in messaging instance .
in mesaging instance in directory jboss-messaging.sar i changed destinations-service.xml to create new queue(testQueue);
below in jms-ds.xml in messaging instance;
| <?xml version="1.0" encoding="UTF-8"?>
|
| <connection-factories>
|
| <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.mq:service=JMSProviderLoader,name=JMSProvider,server=172.16.7.12">
| <attribute name="ProviderName">QueuehostJMSProvider</attribute>
| <attribute name="ProviderAdapterClass">
| org.jboss.jms.jndi.JNDIProviderAdapter
| </attribute>
| <!-- The queue connection factory -->
| <attribute name="QueueFactoryRef">/XAConnectionFactory</attribute>
| <!-- The topic factory -->
| <attribute name="TopicFactoryRef">/XAConnectionFactory</attribute>
| <!-- Use HAJNDI to access JMS -->
| <attribute name="Properties">
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| java.naming.provider.url=172.16.7.12:1099
| </attribute>
| </mbean>
|
|
| <mbean code="org.jboss.jms.asf.ServerSessionPoolLoader"
| name="jboss.messaging:service=ServerSessionPoolMBean,name=StdJMSPool">
| <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
| <attribute name="PoolName">StdJMSPool</attribute>
| <attribute name="PoolFactoryClass">org.jboss.jms.asf.StdServerSessionPoolFactory</attribute>
| </mbean>
|
|
| <tx-connection-factory>
| <jndi-name>JmsXA</jndi-name>
| <xa-transaction/>
| <rar-name>jms-ra.rar</rar-name>
| <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
| <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Queue</config-property>
| <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/QueuehostJMSProvider</config-property>
| <max-pool-size>20</max-pool-size>
| <security-domain-and-application>JmsXARealm</security-domain-and-application>
| <depends>jboss.messaging:service=ServerPeer</depends>
| </tx-connection-factory>
|
| </connection-factories>
|
in messaging instance only i changed standardjboss.xml
****************************************************
|
| <invoker-proxy-binding>
| <name>my-mdb-invoker</name>
| <invoker-mbean>message-driven-bean</invoker-mbean>
| <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
| <proxy-factory-config>
| <JMSProviderAdapterJNDI>QueuehostJMSProvider</JMSProviderAdapterJNDI>
| <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
| <MinimumSize>1</MinimumSize>
| <MaximumSize>15</MaximumSize>
| <KeepAliveMillis>30000</KeepAliveMillis>
| <MaxMessages>1</MaxMessages>
| <MDBConfig>
| <ReconnectIntervalSec>10</ReconnectIntervalSec>
| <DLQConfig>
| <DestinationQueue>queue/DLQ</DestinationQueue>
| <MaxTimesRedelivered>10</MaxTimesRedelivered>
| <TimeToLive>0</TimeToLive>
| </DLQConfig>
| </MDBConfig>
| </proxy-factory-config>
| </invoker-proxy-binding>
|
in the corresponding mdb.ear i changed jboss.xml
********************************
|
| <message-driven>
| <ejb-name>ExampleMessageDrivenBean</ejb-name>
| <configuration-name>Standard Message Driven Bean</configuration-name>
| <destination-jndi-name>queue/testQueue</destination-jndi-name>
| <invoker-bindings>
| <invoker>
| <invoker-proxy-binding-name>my-mdb-invoker</invoker-proxy-binding-name>
| </invoker>
| </invoker-bindings>
| </message-driven>
|
client code is in default instance
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
env.put(Context.PROVIDER_URL, "172.16.7.12:1099");
Context remoteCtx = new InitialContext(env);
Queue queue = (Queue)remoteCtx.lookup("queue/testQueue");
QueueConnectionFactory queueFactory = (QueueConnectionFactory)remoteCtx.lookup("java:JmsXA");
I am getting JmsXA not bound exception(what is the right way of look up ?)
when i changed from JmsXA to java:/XAConnectionFactory i am getting queueFactory but i am getting below exception.
javax.jms.InvalidDestinationException: Destination is not an instance of SpyDestination JBossQueue[testQueue]
see my messaging instance log file
2006-12-05 16:37:24,986 34739 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/DLQ] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-05 16:37:25,032 34785 INFO [org.jboss.jms.server.destination.Topic] @main Topic[/topic/testTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-05 16:37:25,032 34785 INFO [org.jboss.jms.server.destination.Topic] @main Topic[/topic/securedTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-05 16:37:25,048 34801 INFO [org.jboss.jms.server.destination.Topic] @main Topic[/topic/testDurableTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-05 16:37:25,251 35004 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/testQueue] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-05 16:37:25,298 35051 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/A] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-05 16:37:25,298 35051 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/B] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-05 16:37:25,314 35067 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/C] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-05 16:37:25,329 35082 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/D] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-05 16:37:25,345 35098 INFO [org.jboss.jms.server.destination.Queue] @main Queue[/queue/ex] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-05 16:37:25,345 35098 INFO [org.jboss.jms.server.destination.Topic] @main Topic[/topic/openTopic] started, fullSize=75000, pageSize=2000, downCacheSize=2000
2006-12-05 16:37:25,939 35692 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] @main Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA to JNDI name 'java:JmsXA'
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991242#3991242
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991242
More information about the jboss-user
mailing list