3 Replies Latest reply on Jun 11, 2009 4:56 AM by chopper

    MDB Reading On Remote Topic

      Hello, my name is Giuseppe,

      This is the situation:

      I have 2 JBoss installed on my PC (kubuntu 9.04).

      JBoss A (v 4.2.3) updated with Messaging and JBoss B (v 5.0.0, native Messaging, JBPM installed).

      With this commands i obtain 2 "virtual" ip address on my pc:
      sudo ip addr add 192.168.0.203 dev lo
      sudo ip addr add 192.168.0.209 dev lo

      A Java web application with servlet must be deployed on JBoss A: it sends messages on a topic.

      I made this topic adding this code to the file destination-services.xml into directory...deploy/messaging of JBoss A

      <mbean code="org.jboss.jms.server.destination.TopicService"
       name="jboss.messaging.destination:service=Topic,name=pyTopic"
       xmbean-dd="xmdesc/Topic-xmbean.xml">
       <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
       <depends>jboss.messaging:service=PostOffice</depends>
       </mbean>
      


      then i added into jms-ds.xml in JBoss B the following JMSProvider:

       <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider,server=http://192.168.0.203">
       <attribute name="ProviderName">RemoteJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
       <!-- The connection factory -->
       <attribute name="FactoryRef">XAConnectionFactory</attribute>
       <!-- The queue connection factory -->
       <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
       <!-- The topic factory -->
       <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
       <!-- Connect to JNDI on the host "the-remote-host-name" port 1099-->
       <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jnp.interfaces
       java.naming.provider.url=192.168.0.203:1099
       </attribute>
       </mbean>
      


      and Into my standardjboss.xml (JBoss B) i added an

      <invoker-proxy-binding>
       <name>my-mdb-invoker</name>
       <invoker-mbean>does-not-matter</invoker-mbean>
       <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
       <proxy-factory-config>
       <JMSProviderAdapterJNDI>RemoteJMSProvider</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>
      


      finally in jboss.xml (into the MDB) i have something like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss>
       <enterprise-beans>
       <message-driven>
       <ejb-name>NotificationHandlerBean</ejb-name>
       <destination-jndi-name>topic/pyTopic</destination-jndi-name>
       <invoker-bindings>
       <invoker>
       <invoker-proxy-binding-name>my-mdb-invoker</invoker-proxy-binding-name>
       </invoker>
       </invoker-bindings>
       </message-driven>
       </enterprise-beans>
      </jboss>
      
      


      I used Netbeans 6.5.1 developing both Sender (servlet) and Receiver (MDB) application.

      Now i execute jbossA on 192.168.0.203 and jbossB on 192.168.0.209..

      I tryed different solution but the error seems to be always the same:

      *** CONTEXTS IN ERROR: Name -> Error

      jboss.j2ee:binding=my-mdb-invoker,jndiName=local/NotificationHandlerBean@2732525,plugin=invoker,service=EJB -> org.jboss.deployment.DeploymentException: Themessage-destination 'pyTopic' has no jndi-name in jboss.xml


      Please help me..i'm in trouble!!!

      Thanks a lot...