1 2 3 Previous Next 32 Replies Latest reply on Jun 21, 2006 5:55 AM by timfox Go to original post
      • 15. Re: A simple JMS Client won't work - Errors with different j
        timfox

        So you are saying, that you have an object in JNDI (the XAConnectionFactory), that we have validated is there but you fail to look it up.

        This sounds like an issue with the way you are using JNDI. Can you look up other objects from the same global jndi (e.g. the testQueue)?

        You should also check your jndi settings.

        Can you post your settings and your lookup code?

        • 16. Re: A simple JMS Client won't work - Errors with different j
          dv_lakshmi

          Correct. I am able to lookup other objects like XAConnectionFactory, testQueue etc, but not WMXQueueConnectionFactory. Here are my jndi settings.

          env.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory" );
           env.put("java.naming.provider.url","jnp://localhost:1099");
           env.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
          </code>
          
          and the lookup code
          
          queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup("WMXConnectionFactory");
          [/code>
          
          Can I im you ?
          


          • 17. Re: A simple JMS Client won't work - Errors with different j
            dv_lakshmi

            Apologize thats a typo, the lookup code is as follows

            queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup("WMXQueueConnectionFactory");
            </code]


            • 18. Re: A simple JMS Client won't work - Errors with different j
              timfox

              The XAConnectionFactory is the object registered in the JNDI tree at /XAConnectionFactory, this is the one you want to use.

              The WMXQueueConnectionFactory is a JCA aware connection factory - I don't know why you are creating that.

              • 19. Re: A simple JMS Client won't work - Errors with different j
                timfox

                The JCA aware connection factory is only valid in the same VM afaik

                • 20. Re: A simple JMS Client won't work - Errors with different j
                  timfox

                  Also see the note at the bottom of this page:

                  http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigDataSources

                  • 21. Re: A simple JMS Client won't work - Errors with different j
                    dv_lakshmi

                    OK. Here are more interesting problems. We have a test application which is hosted as a jnlp, which simulates the actual process of sending / receiving messages from external systems. Iam able to lookup XAConnectionFactory from a standalone JMSclient program and send messages without any problems. However, when the webstart program tries to post a message using XAConnectionFactory, it gives the following exception.

                    org.jboss.jms.util.MessagingJMSException: Cannot start callbackserver after 50 retries
                    
                     at org.jboss.jms.client.remoting.JMSRemotingConnection.<init>(JMSRemotingConnection.java:153)
                    
                     at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.invoke(ClientConnectionFactoryDelegate.java:158)
                    
                     at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N6840474864420126404.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N6840474864420126404.java)
                    
                     at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:80)
                    
                     at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
                    
                     at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N6840474864420126404.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N6840474864420126404.java)
                    
                     at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:69)
                    
                     at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N6840474864420126404.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N6840474864420126404.java)
                    
                     at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
                    
                     at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N6840474864420126404.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N6840474864420126404.java)
                    
                     at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
                    
                     at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:203)
                    
                     at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:109)
                    
                     at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:104)
                    
                     at org.sturim.xltester.common.Publisher.initializeJMS(Publisher.java:307)
                    
                     at org.sturim.xltester.common.Publisher.init(Publisher.java:173)
                    
                     at org.sturim.xltester.test.Test$ExecutionDaemon.run(Test.java:1408)
                    
                     at java.lang.Thread.run(Unknown Source)
                    
                    



                    Ideally, I would want to use a XA connection factory deployed in the name of WMXQueueConnectionFactory and be able to look up the connectionfactory from the application deployed, stand alone client and jnlp program. If not can you suggest an alternative. Thanks for your speedy response.

                    • 22. Re: A simple JMS Client won't work - Errors with different j

                      I think you can modify/create a name in the connection-factories-service.xml to whatever name you wish to.

                      Thanks
                      Madhu

                      • 23. Re: A simple JMS Client won't work - Errors with different j
                        timfox

                        I don't know much about jnlp, but I guess it runs in a SecurityManager which won't allow you to open sockets and listen on them for security reasons.

                        In order to receive messages using the default socket transport the client needs to open server sockets so it can listen and receive messages.

                        On your second point, why don't you just use XAConnectionFactory??

                        If you really want to bind it under a different name then this is covered in the getting started guide section 5.4

                        • 24. Re: A simple JMS Client won't work - Errors with different j
                          dv_lakshmi

                          Yes, I followed diligently the instructions in guide section 5.4 and created a connection factory under a different name. Using the connection factory configured as instructed, I see StaleObjectException in my application as it expects an XA connection. However, I do not see the instructions to configure a XA connection factory. My application requires an XA connection and is required to keep deployment consistent as we deploy our application on more than one app server.

                          • 25. Re: A simple JMS Client won't work - Errors with different j
                            timfox

                            All connection factories in JBoss Messaging are also XAConnectionFactory instances.

                            I guess you are using it incorrectly - please show me your client side code.

                            • 26. Re: A simple JMS Client won't work - Errors with different j
                              timfox

                              To be clear, this is how you get and use an XAConnection:

                              
                              XAConnectionFactory factory = (XAConnectionFactory)ic.lookup("MyConnectionFactory");
                              
                              XAConnection conn = factory.createXAConnection();
                              
                              XASession sess = conn.createXASession();
                              
                              XAResource res = sess.getXAResource();
                              
                              //enlist resource in global tx etc
                              
                              




                              • 27. Re: A simple JMS Client won't work - Errors with different j
                                dv_lakshmi

                                Whats the solution to the JNLP problem though. I am using XAConnectionFactory as suggested by you, but I get MessagingJMSException while trying to get hte queueConnection.

                                I could post messages from JNLP when jboss was configured with JbossMQ, however with Jboss messaging I am unable to do so.

                                • 28. Re: A simple JMS Client won't work - Errors with different j
                                  timfox

                                  Do you need to receive messages from a jnlp client as well as post them?


                                  I am using XAConnectionFactory as suggested by you, but I get MessagingJMSException


                                  Can you elaborate? Is this happening from a jnlp client, a standalone client or something else?

                                  • 29. Re: A simple JMS Client won't work - Errors with different j
                                    dv_lakshmi

                                    Yes, I need to receive and post messagese from the jnlp client. This is happening from a jnlp client.