1 2 Previous Next 17 Replies Latest reply on May 12, 2008 7:03 AM by Kevin Conner

    Two JBossESBs - what should be the jndi-URL?

    Philip Willemann Newbie

      I have two Windows XP boxes called developer and psc. Each box has JBossESB-server-4.2.1GA. I am currently struggling with the custom_action quickstart. I can get the quickstart to work on each machine, however when I try to get it to work across machines I get naming exceptions and communication exceptions.

      Here is what I did:

      I configured the jboss-esb.xml file on psc to have this
      <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
      jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
      jndi-URL="developer.manassas.progeny.net" >

      I did not change anything on the developer box.
      I have JBoss running its default instance on each box.
      On the psc box I run ant deploy and then ant-runtest. I expect to see something at the developer box. I don't. Instead I see errors at the psc box.

      In playing with the jndi-URL property in jboss-esb.xml, it doesn't seem like anything but localhost works, however I have seen examples in the various JBoss forums that don't use localhost. What am I missing? This is frustrating because it seems like it should be so easy. Thanks for any help

      Phil

        • 1. Re: Two JBossESBs - what should be the jndi-URL?
          Tom Fennelly Master

          Should the jndi-URL not be something like "jnp://developer.manassas.progeny.net:1099" ??

          • 2. Re: Two JBossESBs - what should be the jndi-URL?
            Philip Willemann Newbie

            I entered

            "jnp://developer.manassas.progeny.net:1099" for the jndi-URL in jboss-esb.xml, but I still get the same errors on my psc box. Nothing is happening on the developer box.

            • 3. Re: Two JBossESBs - what should be the jndi-URL?
              Kevin Conner Master

              The first problem is that your esb artifact will not be deployed on the remote system using the QS build.xml, as this only copies into the deploy directory of the installation you specify in your properties file. As a consequence the JMS queues being specified will not have been deployed. You can either deploy the artifact by hand (esb + queues) or just deploy the queues on the remote machine.

              The second issue is that your client is, almost certainly, not using the right configuration for the remote machine.

              If you are communicating via the JMS gateway then you will have to update jndi.properties to point to the remote machine.

              If you are using the ESB aware endpoint then you may have to update juddi.properties to point to the other juddi installation, unless it is clustered with the local one or you have deployed the esb artifact locally.

              • 4. Re: Two JBossESBs - what should be the jndi-URL?
                Philip Willemann Newbie

                Right now I am only testing the JMS portion. Here is what I did:

                I ran ant deploy for the custom action quickstart on both nodes. The queues are already deployed on both.

                I did not make any changes to the remote machine. Its queues are just waiting.

                On the local machine I only changed the jboss-esb.xml file. I did not change the jndi.properties file as you suggest. It currently has this

                # DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING
                #
                java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
                java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

                Questions

                1. Do I need to change both files? (jboss-esb.xml and jndi.properties)
                2. What should the entry in jndi.properties look like?

                Meanwhile I will keep trying.

                Thanks for your quick response and having to deal with a newbie



                • 5. Re: Two JBossESBs - what should be the jndi-URL?
                  Philip Willemann Newbie

                  More information:

                  I added this to my local jndi.properties:

                  java.naming.provider.url=192.168.35.133

                  The Ip is the Ip of the remote box.
                  I can ping this box with no issues.
                  It's JBoss instance is running and I ran ant runtest on the remote box to make sure the queues exist.

                  I can't even get out of the local box. I get the following error:


                  **** - Startup log info before this ****

                  14:16:48,257 WARN [NamingBeanImpl] Context.PROVIDER_URL in server jndi.properties, url=192.168.35.133
                  14:16:49,034 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
                  14:16:49,034 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer
                  14:16:49,205 INFO [TransactionManagerService] Starting recovery manager
                  14:16:49,283 INFO [TransactionManagerService] Recovery manager started
                  14:16:49,283 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
                  14:16:55,221 WARN [ServiceController] Problem starting service jboss:service=TransactionManager
                  javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.35.133 and discovery fail
                  ed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException
                  : Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server 192.168.35.133:
                  1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 192.168.35.133:1099 [Root
                  exception is java.net.ConnectException: Connection refused: connect]]]
                  at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1416)
                  at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:484)
                  at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:477)
                  at javax.naming.InitialContext.rebind(InitialContext.java:367)
                  at com.arjuna.ats.jta.utils.JNDIManager.bindJTATransactionSynchronizationRegistryImplementation(JNDIManager.java
                  :157)
                  at com.arjuna.ats.jta.utils.JNDIManager.bindJTATransactionSynchronizationRegistryImplementation(JNDIManager.java
                  :141)
                  at com.arjuna.ats.jbossatx.jta.TransactionManagerService.startService(TransactionManagerService.java:206)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                  at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)


                  Are the configuration steps for this is some guide I haven't read yet

                  • 6. Re: Two JBossESBs - what should be the jndi-URL?
                    Kevin Conner Master

                     

                    "pwillemann" wrote:
                    14:16:48,257 WARN [NamingBeanImpl] Context.PROVIDER_URL in server jndi.properties, url=192.168.35.133


                    Sorry, but it looks like you have changed the jndi.properties file for the server and not the one within the quickstart directory.

                    Can we start from the beginning? Can you list the files that you have modified and say what you have done?

                    • 7. Re: Two JBossESBs - what should be the jndi-URL?
                      Philip Willemann Newbie

                      I have two nodes - both Windows XP
                      I am running jbossesb-server-4.2.1-GA

                      Node 1 - developer - IP 192.168.35.145
                      I have not changed any files

                      Node 2 - psc - IP - 192.168.35.133

                      I changed the property java.naming.provide.url in C:\jbossesb-server-4.2.1GA\samples\quickstarts\custom_action.

                      It is now 192.168.35.145 <== It is pointing to developer

                      I also changed jboss-esb.xml in the same directory. Its jndi-url is set to
                      jndi-URL="192.168.35.145" >

                      For developer, I run ant deploy and ant runtest. I assume runtest sets up the queues.

                      For psc, I run ant deploy and ant runtest.


                      • 8. Re: Two JBossESBs - what should be the jndi-URL?
                        Kevin Conner Master

                        For developer you should just run 'ant deploy-jms-dests'.

                        For psc you should modify the jndi attributes in jboss-esb.xml to point to developer, you should also modify the jndi.properties. You should then run 'ant deploy' and 'ant runtest'

                        What I don't understand is how the server could have picked up this JNDI configuration if you have not modified any of the server files, do you have a classpath set?

                        • 9. Re: Two JBossESBs - what should be the jndi-URL?
                          Philip Willemann Newbie

                          I think the server picked up the JNDI configuration because I used the wrong IP. Sorry for the confusion.

                          Latest test - Order I did things


                          On the developer node - no file changes to anything

                          1. Restarted ESB, JBoss comes up fine.
                          2. Navigated to custom_action folder and entered ant deploy-jms-dests.
                          3. Went to ESB console screen and see the queues (jms and ESBs too.)

                          Then on the psc node


                          1. Navigated to custom_action folder. In the jboss-esb.xml file I changed jndi-url to 192.168.35.145. Outside of this, the file is as it originally was.
                          2. Navigated to custom_action folder. In the jndi-properties file, I made sure this line was present:
                          java.naming.provider.url=192.168.35.145
                          3 Restarted the ESB. JBoss comes up fine
                          4. From another console, and within the custom_action folder, I entered ant deploy
                          5. Before I can even run ant runtest I get an error message like this:

                          16:12:15,180 INFO [JBoss4ESBDeployer] create esb service, Quickstart_custom_action.esb
                          16:12:15,243 INFO [QueueService] Queue[/queue/quickstart_custom_action_GW] started, fullSize=200000, pageSize=2000, dow
                          nCacheSize=2000
                          16:12:15,259 INFO [QueueService] Queue[/queue/quickstart_custom_action_ESB] started, fullSize=200000, pageSize=2000, do
                          wnCacheSize=2000
                          16:12:15,259 INFO [QueueService] Queue[/queue/quickstart_custom_action_ESB_reply] started, fullSize=200000, pageSize=20
                          00, downCacheSize=2000
                          16:12:15,433 INFO [STDOUT]

                          Constructor - org.jboss.soa.esb.samples.quickstart.customaction.StatefulAction
                          16:12:15,497 INFO [JDBCDataStore] Generated token 'authToken:0ED89E90-1884-11DD-AC65-974561ECE869' for user: 'jbossesb/
                          JBoss ESB User'
                          16:12:28,286 INFO [JmsConnectionPool] Received NamingException, refreshing context.
                          16:12:40,282 WARN [ServiceController] Problem starting service jboss.esb:deployment=Quickstart_custom_action.esb
                          org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException: Unexpected configuration exception from prepareMessageR
                          eceiver
                          at org.jboss.soa.esb.listeners.gateway.JmsGatewayListener.doInitialise(JmsGatewayListener.java:118)
                          at org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle.initialise(AbstractManagedLifecycle.java:133)
                          at org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController.initialiseInstances(ManagedLifecycleControll
                          er.java:150)
                          at org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController.start(ManagedLifecycleController.java:69)
                          at org.jboss.soa.esb.listeners.config.JBoss4ESBDeployment.startService(JBoss4ESBDeployment.java:83)
                          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:585)
                          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                          at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                          at $Proxy0.start(Unknown Source)
                          at org.jboss.system.ServiceController.start(ServiceController.java:417)
                          at org.jboss.system.ServiceController.start(ServiceController.java:435)
                          at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:585)
                          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                          at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)

                          6. I have not changed any of the source code in the custom_action folder, but I noticed StatefulAction in the stacktrace. I have no idea why.

                          I'll keep trying.

                          • 10. Re: Two JBossESBs - what should be the jndi-URL?
                            Tom Fennelly Master

                            Can you telnet to the JNDI port on the developer machine, from the psc machine? Make sure the server on the developer machine is not bound to a specific adapter that's only accessible from the developer machine e.g. "localhost". I'm sure that by default, it accepts connections on all adapters (i.e. is bound to "0.0.0.0").

                            Just in case... change the quickstart being deployed on the psc machine to not deploy the JMS Queues.

                            • 11. Re: Two JBossESBs - what should be the jndi-URL?
                              Philip Willemann Newbie

                              From psc I entered:

                              telnet developer 1099
                              The connect fails.

                              I am not sure what you mean by making sure the server is not bound to a specific adapter only accessible from developer. Are we talking about from a hardware perspective or software?

                              I will disable the queues on the psc machine, however at this point I am not entirely sure where I should be disabling. It is not 100% obvious to me. I will try to figure it out and repost as needed.

                              • 12. Re: Two JBossESBs - what should be the jndi-URL?
                                Tom Fennelly Master

                                 

                                "pwillemann" wrote:
                                From psc I entered:

                                telnet developer 1099
                                The connect fails.


                                Assuming the "psc" machine is able to resolve the physical address of the "developer" machine and that the JNDI server is listening on port 1099 (I'm sure that's the default, but check it), then you have a basic networking issue (firewall or something) between the 2 machines. You need to sort this out or it can't work.

                                You could also do a telnet test using the physical IP address of the "developer" machine, just in case there's an address resolution issue.

                                "pwillemann" wrote:
                                I am not sure what you mean by making sure the server is not bound to a specific adapter only accessible from developer. Are we talking about from a hardware perspective or software?


                                I don't think this is your problem, but it would be no harm to understand this anyway. Google something like "JBoss"+"port binding" and have a read wrt binding JBoss to specific ports.

                                "pwillemann" wrote:
                                I will disable the queues on the psc machine, however at this point I am not entirely sure where I should be disabling. It is not 100% obvious to me. I will try to figure it out and repost as needed.


                                Your quickstart has deployment decriptors for the queues. Keep them in the version deployed on the "developer" machine. Remove them for the quickstart on the other machine. This is nothing to do with your current issue, so you don't "need" to do this. I was just suggesting it as having the queues deployed in multiple places can lead to confusing issues.

                                • 13. Re: Two JBossESBs - what should be the jndi-URL?
                                  Philip Willemann Newbie

                                  At the psc box, I turned on the telnet service. It was disabled. I can now telnet into the developer box successfully. I could do it with the developer name and the ip address.
                                  My quickstart still does not work. Same errors as before.
                                  Port 1099 is explicitly open on both machines.

                                  Phil

                                  • 14. Re: Two JBossESBs - what should be the jndi-URL?
                                    Philip Willemann Newbie

                                    More information:

                                    I decided to simplify my test environment. I went back to just one ESB. I wanted to see if I could get the custom_action quickstart to work if I changed the jndi-url from localhost to the IP of the current box.

                                    I had assumed this would work, however it did not. I got the same communication exceptions as before. This does not make any sense to me.

                                    1 2 Previous Next