7 Replies Latest reply on Dec 9, 2003 10:44 AM by Adrian Brock

    MDB connecting to remote queue

    crosscourt Newbie

      i have read all the releated posts but i still have problems!
      =================================
      19:00:47,015 WARN [JMSContainerInvoker] Could not find the queue destination-jndi-name=queue/SmartsQueue
      19:00:47,015 WARN [JMSContainerInvoker] destination not found: queue/SmartsQueue reason: javax.naming.NameNotFoundExcep
      tion: SmartsQueue not bound
      19:00:47,015 WARN [JMSContainerInvoker] creating a new temporary destination: queue/SmartsQueue
      19:00:47,015 INFO [SmartsQueue] Bound to JNDI name: queue/SmartsQueue
      =================================

      I have specified a new JMSProvider:

      RemoteJMSProvider
      org.jboss.jms.jndi.JBossMQProvider
      xx.xx.xx.xx:1199
      XAConnectionFactory
      XAConnectionFactory


      and in jboss.xml

      <message-driven>
      <ejb-name>processor/SmartsProcessor</ejb-name>
      <destination-jndi-name>queue/SmartsQueue</destination-jndi-name>
      <configuration-name>QueryProcessor MDB</configuration-name>
      </message-driven>

      </enterprise-beans>

      <resource-managers>
      </resource-managers>

      <container-configurations>
      <container-configuration>
      <container-name>QueryProcessor MDB</container-name>

      <invoker-proxy-binding-name>message-driven-bean</invoker-proxy-binding-name>
      <container-interceptors>
      org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor
      org.jboss.ejb.plugins.LogInterceptor
      org.jboss.ejb.plugins.RunAsSecurityInterceptor
      <!-- CMT -->
      org.jboss.ejb.plugins.TxInterceptorCMT
      org.jboss.ejb.plugins.MetricsInterceptor
      org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor
      <!-- BMT -->
      org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor
      org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT
      org.jboss.ejb.plugins.MetricsInterceptor
      org.jboss.resource.connectionmanager.CachedConnectionInterceptor
      </container-interceptors>
      <container-invoker-conf>
      RemoteJMSProvider
      StdJMSPool
      2
      1
      True
      </container-invoker-conf>
      <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
      <container-pool-conf>
      1
      true
      </container-pool-conf>
      </container-configuration>
      </container-configurations>


      what else am i missing?

      I can find the queue with this

      Properties props = new Properties();
      props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      props.setProperty(Context.PROVIDER_URL, "xx.xx.xx.xx:1199");
      props.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
      InitialContext ic = new InitialContext(props);

      Object o = ic.lookup("queue/SmartsQueue");
      System.out.println(o);


      thanks

        • 1. Re: MDB connecting to remote queue
          crosscourt Newbie

          am i meant to be using invoker-bindings in 3.2?
          although can't work out how to add that with xdoclet

          <message-driven>
          <ejb-name>SaleMessageBean</ejb-name>
          <destination-jndi-name>queue/testQueue</destination-jndi-name>
          <invoker-bindings>

          <invoker-proxy-binding-name>foo</invoker-proxy-binding-name>

          </invoker-bindings>
          </message-driven>

          • 2. Re: MDB connecting to remote queue
            crosscourt Newbie

            little help!

            2003-12-04 21:03:30,859 WARN [org.jboss.ejb.plugins.jms.JMSContainerInvoker] JMS provider failure detected:
            javax.jms.InvalidDestinationException: The destination QUEUE.SmartsQueue does not exist !
            at org.jboss.mq.server.ClientConsumer.addSubscription(ClientConsumer.java:135)
            at org.jboss.mq.server.JMSDestinationManager.subscribe(JMSDestinationManager.java:603)
            at org.jboss.mq.server.JMSServerInterceptorSupport.subscribe(JMSServerInterceptorSupport.java:296)
            at org.jboss.mq.security.ServerSecurityInterceptor.subscribe(ServerSecurityInterceptor.java:150)
            at org.jboss.mq.server.TracingInterceptor.subscribe(TracingInterceptor.java:677)
            at org.jboss.mq.server.JMSServerInvoker.subscribe(JMSServerInvoker.java:298)
            at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:307)
            at java.lang.Thread.run(Thread.java:536)

            • 3. Re: MDB connecting to remote queue
              Adrian Brock Master

              container-invoker-conf is a 3.0 configuration
              You should use a proxy binding to set the jms provider,
              there are plenty of examples in this forum, including one
              that connects to multiple jms providers :-)

              Regards,
              Adrian

              • 4. Re: MDB connecting to remote queue
                crosscourt Newbie

                read everything i could find in the forum already, still have no idea.

                I tried using just creating a normal connection instead of MDB but i get some diff exception?

                public static void main(String[] args) throws Exception {
                Properties props = new Properties();
                props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                props.setProperty(Context.PROVIDER_URL, "129.xx.xxx.xx:1199");
                props.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
                InitialContext ic = new InitialContext(props);

                Queue queue = (Queue)ic.lookup("queue/SmartsQueue");
                System.out.println(queue);

                QueueConnectionFactory queueConnectionFactory =
                (QueueConnectionFactory)ic.lookup("ConnectionFactory");
                QueueConnection queueConnection =
                queueConnectionFactory.createQueueConnection();

                QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
                QueueBrowser browser = queueSession.createBrowser(queue);

                Enumeration enum = browser.getEnumeration();
                System.out.println(enum.nextElement());
                }


                QUEUE.SmartsQueue
                org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: (java.net.ConnectException: Connection refused: connect)
                at org.jboss.mq.Connection.authenticate(Connection.java:883)
                at org.jboss.mq.Connection.(Connection.java:238)
                at org.jboss.mq.Connection.(Connection.java:315)
                at org.jboss.mq.SpyConnection.(SpyConnection.java:60)
                at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:116)
                at NamingLookup.main(NamingLookup.java:38)
                Caused by: java.net.ConnectException: Connection refused: connect
                at java.net.PlainSocketImpl.socketConnect(Native Method)
                at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                at java.net.Socket.connect(Socket.java:426)
                at java.net.Socket.connect(Socket.java:376)
                at java.net.Socket.(Socket.java:291)
                at java.net.Socket.(Socket.java:147)
                at javax.net.DefaultSocketFactory.createSocket(DashoA6275)
                at org.jboss.mq.il.oil.OILServerIL.createConnection(OILServerIL.java:563)
                at org.jboss.mq.il.oil.OILServerIL.checkConnection(OILServerIL.java:507)
                at org.jboss.mq.il.oil.OILServerIL.authenticate(OILServerIL.java:289)
                at org.jboss.mq.Connection.authenticate(Connection.java:876)
                ... 5 more

                • 5. Re: MDB connecting to remote queue
                  crosscourt Newbie

                  it seems that i can connect to the testQueue, A B C D queues but not the ones that I define my self.

                  still getting
                  javax.jms.InvalidDestinationException: The destination QUEUE.SmartsQueue does not exist

                  • 6. Re: MDB connecting to remote queue
                    crosscourt Newbie

                    please help, i have gone thru many threads already.

                    my jboss.xml

                    <?xml version="1.0" encoding="UTF-8"?>
                    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">



                    <enterprise-beans>

                    <!-- define my own beans -->

                    <message-driven>
                    <ejb-name>processor/SmartsProcessor</ejb-name>
                    <destination-jndi-name>queue/SmartsQueue</destination-jndi-name>
                    <invoker-bindings>

                    <invoker-proxy-binding-name>smarts processor</invoker-proxy-binding-name>

                    </invoker-bindings>
                    </message-driven>

                    </enterprise-beans>

                    <resource-managers>
                    </resource-managers>

                    <invoker-proxy-bindings>
                    <invoker-proxy-binding>
                    smarts processor
                    <invoker-mbean/>
                    <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
                    <proxy-factory-config>
                    RemoteJMSProvider
                    StdJMSPool
                    1
                    1

                    10

                    queue/DLQ
                    10
                    0


                    </proxy-factory-config>
                    </invoker-proxy-binding>
                    </invoker-proxy-bindings>

                    • 7. Re: MDB connecting to remote queue
                      Adrian Brock Master

                      Lets start from scratch shall we.

                      You have the RemoteJMSProvider configured to point
                      at a remote jndi.

                      You have configured this on invoker proxy binding
                      and linked that to the mdb.
                      Where is jboss.xml located.

                      This is all that is required.

                      Are you sure jboss.xml is being read?
                      What happens if you don't deploy RemoteJMSProvider
                      do you get a different error?

                      Try turning on TRACE logging for
                      org.jboss.jms
                      org.jboss.ejb.plugins.jms
                      and looking at log/server.log during deployment.

                      Regards,
                      Adrian