1 2 Previous Next 25 Replies Latest reply on Sep 30, 2009 10:25 PM by Paul Chuang

    Unable to get the jca-config example to work

    Paul Chuang Newbie

      I have JBoss 5.1 and JBM2.0 Beta4 installed on two servers (one Linux and the other Windows XP). I tried to run the example under $JBM_HOME/example/javaee/jca-config and it only partially worked. The message sent from the statelessSender was received by the QueueB (local MDB to the stateless bean) but not by QueueA (remote MDB). I had "ant deploy" running on the remote server and "ant deploy2" on the local server.

      I believe the problem was that the remote host was not defined anywhere. I had tried to add

      <config-property name="ConnectionParameters" type="java.lang.String">jbm.remoting.netty.host=dell</config-property>

      in jms-remote-ds.xml and

      <config-property>
      The transport configuration. These values must be in the form of key=val;key=val;
      <config-property-name>ConnectionParameters</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>jbm.remoting.netty.host=dell</config-property-value>
      </config-property>

      in ra.xml, but it didn't help.

      I would really appreciate if someone could help...

      Paul

        • 1. Re: Unable to get the jca-config example to work
          Tim Fox Master

          First, I'd recommend you use beta5.

          Also moving this question to the hornetq forum

          • 2. Re: Unable to get the jca-config example to work
            Paul Chuang Newbie

            Thank you for your quick reply. I downloaded HornetQ beta5 and looked
            through all the files. They seemed to be exactly the same as beta 4 except
            the name changes. I still didn't find what I was looking for.

            In StatelessSender, jms-remote-ds.xml was used for configuring both
            destQueueA and destQueueB.
            In jms-remote-ds, no host was specified, so I assume the default host is
            localhost and destQueueB was getting messages.

            I had tried to add host to this file (in beta4) and it didn't work. I will
            try again in beta 5, but it seemed to me that even if it works, only one
            Queue would receive message... How to get the statelessSender to send
            messages to both remote queues?

            The SessionDefaultType in jms-remote-ds.xml was Topic, I changed it to
            Queue when I tried with beta4 but it made no difference.

            I would really appreciate any pointers and help.

            Paul

            • 3. Re: Unable to get the jca-config example to work
              Clebert Suconic Master

               

              I have JBoss 5.1 and JBM2.0 Beta4 installed on two servers (one Linux and the other Windows XP). I tried to run the example under $JBM_HOME/example/javaee/jca-config and it only partially worked. The message sent from the statelessSender was received by the QueueB (local MDB to the stateless bean) but not by QueueA (remote MDB). I had "ant deploy" running on the remote server and "ant deploy2" on the local server.



              You have to change the connectionParameters to:

              
               <config-property>
               <description>The transport configuration. These values must be in the form of key=val;key=val;</description>
               <config-property-name>ConnectionParameters</config-property-name>
               <config-property-type>java.lang.String</config-property-type>
               <config-property-value>hornetq.remoting.netty.host=YOURHOST;hornetq.remoting.netty.port=5445</config-property-value>
               </config-property>
              
              


              • 4. Re: Unable to get the jca-config example to work
                Clebert Suconic Master

                I had this text on my message before, but I removed it by accident:


                Since you're running the server in a different host, you have to also specify the host IP or Name. Look at your ra.xml.


                I have already added the configuration change you would have to make.

                • 5. Re: Unable to get the jca-config example to work
                  Paul Chuang Newbie

                  Thank you for your help. I am still not clear about multiple remote queues. Since both A and B are considered as remote queues, the message will only be forwarded to YOURHOST specified in jms-remote-ds.xml, right? Can I have multiple remoting.netty.host entries?

                  • 6. Re: Unable to get the jca-config example to work
                    Paul Chuang Newbie

                    I added my remote host (dell) to the ra.xml as follows:

                    <config-property>
                    The transport configuration. These values must be in the form of key=val;key=val;
                    <config-property-name>ConnectionParameters</config-property-name>
                    <config-property-type>java.lang.String</config-property-type>
                    <config-property-value>hornetq.remoting.netty.host=dell;hornetq.remoting.netty.port=5445</config-property-value>
                    </config-property>

                    I also added the remote host information in jms-remote-ds.xml (not sure this is the right syntax):

                    <config-property name="ConnectionParameters" type="java.lang.String">hornetq.remoting.netty.host=dell;hornetq.remoting.netty.port=5445</config-property>

                    I got the following error with ant deploy2:

                    [exec] SEVERE: Unabler to start activation
                    [exec] HornetQException[errorCode=2 message=Unable to connect to server using configuration org-hornetq-integration-transports-
                    tty-NettyConnectorFactory?hornetq-remoting-netty-port=5445&hornetq-remoting-netty-host=dell]
                    [exec] at org.hornetq.core.client.impl.ConnectionManagerImpl.createSession(ConnectionManagerImpl.java:290)
                    ...

                    I added -b 0.0.0.0 in builder.xml for both of my (remote and local) servers.

                    I am a glasssfish user, and need to exchange messages between JBoss and Glassfish, from the documentation, JBoss Messaging seemed to be just what I need, but I have been having so much trouble to just get messages passed back and forth between 2 JBoss servers (on separate platforms)...

                    Any help will be greatly appreciated....

                    • 7. Re: Unable to get the jca-config example to work
                      Tim Fox Master

                      Please post your full HornetQ config for both machines.

                      • 8. Re: Unable to get the jca-config example to work
                        Tim Fox Master

                        Either

                        a) You haven't started an acceptor listening on host "DELL"
                        b) The hostname DELL does not resolve from your other box.

                        • 9. Re: Unable to get the jca-config example to work
                          Paul Chuang Newbie

                          The HornetQ config files were the same as downloaded except the host names I added.

                          How do I start an acceptor on DELL? I started both deploy and deploy 2, anything else I need to add to the config files?

                          I think DELL is resolved. I could ping dell and if I change localhost to dell in config/jndi.properties, I was able to send messages to both queues on dell.

                          Thank you.

                          • 10. Re: Unable to get the jca-config example to work
                            Tim Fox Master

                            If you look in your hornetq-configuration.xml (this will be called jbm-configuration.xml if you're using beta4 still) file you will see all your acceptors defined.

                            I'd suggest familiarising yourself with the user manual chapter on connector and acceptors:

                            http://hornetq.sourceforge.net/docs/hornetq-2.0.0.BETA5/user-manual/en/html/configuring-transports.html

                            The way in which servers accept connections from other nodes is defined in the set of acceptors.

                            E.g. I might define an acceptor that listens for TCP connections on port 12345 and Ip address 192.168.1.123

                            The default acceptor just listens on localhost - so it won't be able to accept connections from remote boxes.

                            if you want your server to be contactable from other machines you need to configure the acceptor with a hostname or ipaddress, and that's the address it will listen at.

                            • 11. Re: Unable to get the jca-config example to work
                              Paul Chuang Newbie

                              Thanks, Tim. I tried to add the host information the configuration file, but still couldn't get it to work... I have two hosts, named jboss and dell. I want to have the statelessSender on jboss to put messages in the queue on dell. In hornetq-config.xml on Dell, I have

                               <!-- Netty TCP Acceptor -->
                               <acceptor name="netty">
                               <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
                               <param key="hornetq.remoting.netty.host" value="${hornetq.remoting.netty.host:jboss}" type="String"/>
                               <param key="hornetq.remoting.netty.port" value="${hornetq.remoting.netty.port:5445}" type="Integer"/>
                               </acceptor>
                               </acceptors>
                              

                              I tried with and without the host information (host and port) in hornetq-configuration.xml on jboss:
                               <connector name="netty">
                               <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
                               <param key="hornetq.remoting.netty.host" value="${hornetq.remoting.netty.host:dell}" type="String"/>
                               <param key="hornetq.remoting.netty.port" value="${hornetq.remoting.netty.port:5445}" type="Integer"/>
                               </connector>
                              

                              There was no error when I started deploy and deploy2. when I tried to run, both queue A and B on jboss received messages but not queue A on the remote host dell.

                              I have also tried other combinations in configurations and added host in ra.xml and jms-remote-ds.xml as Clebert had suggested, but they all ended up with errors and exceptions (org.jboss.netty.channel.ChannelException: Failed to bind to: dell/172.17.5.13:5445 and others).

                              Is it possible that you can send me some working sample code? I just need to be able to have EJB or MDB on one host to place messages to a queue on another host.... hope this is not too much to ask. I had spent many hours on this by trials and error but nothing seemed to work.. Would really appreciate if you could help.

                              Thank you,
                              Paul


                              • 12. Re: Unable to get the jca-config example to work
                                Tim Fox Master

                                 

                                "mantaroesg" wrote:
                                and exceptions (org.jboss.netty.channel.ChannelException: Failed to bind to: dell/172.17.5.13:5445 and others).


                                That means it's an invalid ip address for that machine. Check your ip addresses.

                                • 13. Re: Unable to get the jca-config example to work
                                  Tim Fox Master

                                   

                                  "mantaroesg" wrote:


                                  Is it possible that you can send me some working sample code?


                                  Well... the working example code is in the examples in the distro. Not sure what else to suggest.

                                  • 14. Re: Unable to get the jca-config example to work
                                    Tim Fox Master

                                    But if you're getting "cannot bind" exceptions, it more or less certainly means that machine doesn't have that ip address.

                                    What operating system are you running?

                                    1 2 Previous Next