This discussion is archived
4 Replies Latest reply: Sep 29, 2012 2:26 AM by 965101 RSS

MDB cannot connect to JMS destination using Foreign Server

965101 Newbie
Currently Being Moderated
Hi everyone,
I have configured foreign jms server in weblogic but when MDB tries to connect to specific queue, it gets the following exception:
I would really appreciate if anyone could help me.

<Sep 28, 2012 5:23:34 PM CEST> <Warning> <EJB> <BEA-010096> <The Message-Driven EJB: SmsReceiver is unable to connect to the JMS destination or bind to JCA resource adapter: xcg2/smsInQueue. Connection failed after 2 attempts. The MDB will attempt to reconnect/rebind every 10 seconds. This log message will repeat every 600 seconds until the condition clears.>
<Sep 28, 2012 5:23:34 PM CEST> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: SmsReceiver is unable to connect to the JMS destination: xcg2/smsInQueue. The Error was:
[EJB:011010]The JMS destination with the JNDI name: jmsxcg.out could not be found. Please ensure that the JNDI name in the weblogic-ejb-jar.xml or corresponding annotation is correct, and the JMS destination has been deployed.
javax.naming.InvalidNameException: jmsxcg.out: [LDAP: error code 34 - Invalid DN]; remaining name 'jmsxcg.out' NestedException Message is :jmsxcg.out: [LDAP: error code 34 - Invalid DN]>


MDB annotation looks like this:
@MessageDriven(name="SmsReceiver", mappedName="xcg2/smsInQueue",
activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
})
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class SmsReceiverBean implements MessageListener


weblogic-ejb-jar.xml excerpt:

     <weblogic-enterprise-bean>
          <ejb-name>SmsReceiver</ejb-name>
          <message-driven-descriptor>
               <pool>
                    <max-beans-in-free-pool>10</max-beans-in-free-pool>
                    <initial-beans-in-free-pool>5</initial-beans-in-free-pool>
               </pool>
               <connection-factory-jndi-name>echoQueueConnectionFactory</connection-factory-jndi-name>
          </message-driven-descriptor>
          <transaction-descriptor>
               <trans-timeout-seconds>600</trans-timeout-seconds>
          </transaction-descriptor>
<dispatch-policy>MdbSmsWorkManager</dispatch-policy>
     </weblogic-enterprise-bean>


and the configuration of foreign-server:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-jms xmlns="http://www.bea.com/ns/weblogic/weblogic-jms">
<foreign-server name="serverr">
<sub-deployment-name>Subdeployment</sub-deployment-name>
<foreign-destination name="sms queue>
<local-jndi-name>xcg2/smsInQueue</local-jndi-name>
<remote-jndi-name>jmsxcg.out</remote-jndi-name>
</foreign-destination>
<foreign-connection-factory name="Connection Factory">
<local-jndi-name>echoQueueConnectionFactory</local-jndi-name>
<remote-jndi-name>QueueConnectionFactory</remote-jndi-name>
</foreign-connection-factory>
<initial-context-factory>com.tibco.tibjms.naming.TibjmsInitialContextFactory</initial-context-factory>
<connection-url>tibjmsnaming://xx.xx.xx.xx:7222</connection-url>
</foreign-server>
</weblogic-jms>


PS. I'm able to connect to the weblogic jndi, get connectionFactory echoQueueConnectionFactory, then lookup queue and grab messages so that's i suspect there is something wrong with configuration
  • 1. Re: MDB cannot connect to JMS destination using Foreign Server
    Tom B Expert
    Currently Being Moderated
    Hmm - I'm not sure what's going on. Two thoughts --

    Thought 1 - According to my (admittedly minimal) research, Tibco is complaining about a syntax error in the lookup name. Perhaps the problem has something to do with your use of a "." in the queue name "jmsxcg.out": WL or Tibco JNDI might be interpreting the "." as a subcontext or some-such. Perhaps try renaming the queue to "jmsxcg_out" throughout (in Tibco and in your Foreign JMS reference).

    Thought 2 - It probably won't make a difference, but you might want try specifying the source destination via the "destinationJndiName" config property instead of via "mappedName".
    @MessageDriven(
      name = "MyMDB",
      activationConfig = {
        @ActivationConfigProperty(propertyName  = "destinationType", 
                                  propertyValue = "javax.jms.Queue"),
     
        @ActivationConfigProperty(propertyName  = "destinationJndiName",
                                  propertyValue = "MyQueue") // Ext. JNDI Name
      }
    )
    HTH,

    Tom
  • 2. Re: MDB cannot connect to JMS destination using Foreign Server
    965101 Newbie
    Currently Being Moderated
    Thank you for you reply. Unfortunately the second option didn't helped. The problem looks really strange. As i Imentioned, I made simple client application that connects to Weblogic(through InitialContext), then lookup from its JNDI tree echoQueueConnectionFactory (local jndi conecction factory), and then xcg2/smsInQueue (local jndi name of the queue). And this actually works, as I am able to receive messages from the jmsxcg.out queue. There are also two other jms modules within this weblogic and which contain remote jndi queues names which contain "." in name and it works. But maybe it's not the same in this situation.
  • 3. Re: MDB cannot connect to JMS destination using Foreign Server
    Tom B Expert
    Currently Being Moderated
    Hi,

    It still seems worth trying the first option, at least for the purpose of trying and narrow down the root cause. It may be quickest just to change the remote destination JNDI name in the foreign JMS configuration to remove the ".".

    In theory, the MDB should then start failing with a different type of exception instead of a "34" Tibco syntax error (hopefully some sort of Tibco "entry not found" equivalent error code). Then, change the JNDI name of the Tibco destination in the Tibco configuration to match, to see if the messages start flowing.

    Tom
  • 4. Re: MDB cannot connect to JMS destination using Foreign Server
    965101 Newbie
    Currently Being Moderated
    hi Tom,
    Thank you for reply. I recreated the domain and configured the same settings again but this time through Administration Console and it works. Previous time I made necessary changes just by editing config.xml and and creating echomodule-jms.xml by hand. Maybe there was some blank spaces or other invisible character issues?:) Anyway the file that weblogic created just works.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points