Remote Producers
vlewis Feb 10, 2005 3:08 PMI am using JBoss 4.0.1 on Win2k with J2SE 1.4.2.
I have read the FAQ, Read Me First and Read Me Second. I have also searched this and other forums but have been unable to figure out what I am doing wrong.
I have MDB which consumes messages from one queue and produce messages for another. While I am able to get the MDBs to consume off a remote queue they are unable to find the remote queues to which I wish to publish.
What I have done:
Added the following to my jms-ds.xml on the remote host:
<mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.mq:service=JMSProviderLoader,name=PromJMSProvider,server=devserver3a"> <attribute name="ProviderName">PromJMSProvider</attribute> <attribute name="ProviderAdapterClass"> org.jboss.jms.jndi.JNDIProviderAdapter </attribute> <!-- The combined connection factory --> <attribute name="FactoryRef">XAConnectionFactory</attribute> <!-- The queue connection factory --> <attribute name="QueueFactoryRef">XAConnectionFactory</attribute> <!-- The topic factory --> <attribute name="TopicFactoryRef">XAConnectionFactory</attribute> <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=devserver3a:1099 </attribute> </mbean> <tx-connection-factory> <jndi-name>PromJmsXA</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.Topic</config-property> <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/PromJMSProvider</config-property> <max-pool-size>20</max-pool-size> <security-domain-and-application>PromJmsXARealm</security-domain-and-application> </tx-connection-factory>
Added this to my login-config.xml on the remote host:
<application-policy name = "PromJmsXARealm"> <authentication> <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required"> <module-option name = "principal">guest</module-option> <module-option name = "userName">guest</module-option> <module-option name = "password">guest</module-option> <module-option name = "managedConnectionFactoryName">jboss.jca:service=TxCM,name=PromJmsXA</module-option> </login-module> </authentication> </application-policy>
As I mentioned the MDBs are receiving messages from the remote queues but for completeness here is the change I made to message-driven-bean (I want all MDBs on this server to use remote queues):
<invoker-proxy-binding> <name>message-driven-bean</name> <invoker-mbean>default</invoker-mbean> <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory> <proxy-factory-config> <JMSProviderAdapterJNDI>PromJMSProvider</JMSProviderAdapterJNDI> <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI> <!-- WARN: Don't set this to zero until a bug in the pooled executor is fixed --> <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>
Here is the jboss.xml for one of the remote MDBs
<message-driven> <ejb-name>FileIDFP</ejb-name> <destination-jndi-name>queue/FileId</destination-jndi-name> <resource-ref> <res-ref-name>jms/ConnectionFactory</res-ref-name> <jndi-name>java:/PromJmsXA</jndi-name> </resource-ref> <resource-env-ref> <resource-env-ref-name>jms/Answers</resource-env-ref-name> <jndi-name>queue/JobsAnswers</jndi-name> </resource-env-ref> </message-driven>
I then get this exception:
javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: JobsAnswers not bound]
on the line in which I attempt to get the destination I whish to send messages to:
Destination destination = (Destination)jndiContext.lookup("java:comp/env/jms/Answers");
I am really at a loss as to what to try next. Might someone please help.
Thank You,
Victor