1 2 Previous Next 15 Replies Latest reply on Mar 22, 2007 6:38 PM by kurtstam

    Unable to connect to registry

    gwstern

      Hi,

      I'm trying to setup a simple ZUL->Spring->gateway->ESB->queue->Listener->Action and back flow. I've got the ZUL->Spring->ESB part working but when I try to invoke the Action I get:

      16:24:43,092 ERROR [JAXRRegistryImpl] Could not set up a connection to the Registry. Failed to create instance of: null javax.xml.registry.JAXRException: Failed to create instance of: null
      

      when I call registry.findEPR ('ConfigurationManagement', 'whoAmI');
      I've using the default JUDDI stuff and I get no errors when I start or redeploy but once I try to call my action, JBossConfigurationManagementAction(), I get this error. I've got two wars:

      o) GUI.war which contains the ZUL stuff (this seems to work fine)
      o) config_mgr.war which contains my service (subclassing ActionProcessor) and jbossesb.xml

      <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd"
       parameterReloadSecs="5000">
       <providers>
       <jms-provider name="JBossMQ"
       connection-factory="ConnectionFactory"
       jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
       jndi-URL="localhost">
       <jms-bus busid="quickstartGwChannel">
       <jms-message-filter
       dest-type="QUEUE"
       dest-name="queue/A"
       />
       </jms-bus>
       <jms-bus busid="ConfigurationManagementWhoAmI">
       <jms-message-filter dest-type="QUEUE"
       dest-name="queue/B"
       selector="function='request' "/>
       </jms-bus>
       </jms-provider>
       </providers>
       <services>
       <service category="ConfigurationManagement"
       name="whoAmI"
       description="Who Am I">
       <listeners>
       <jms-listener name="JMS-Gateway"
       busidref="quickstartGwChannel"
       maxThreads="1"
       is-gateway="true"
       />
       <jms-listener name="whoAmI"
       busidref="ConfigurationManagementWhoAmI"
       maxThreads="1"/>
       </listeners>
       <actions>
       <action class="com.jeppesen.aoc.configurationmanagement.JBossConfigurationManagementAction"
       name="action1">
       </action>
       </actions>
       </service>
       </services>
      </jbossesb>
      

      Questions:

      1) I'm not using StandAloneBootStrapper - should I be ?
      2) Does the jbossesb.xml file need to be called jbossesb.xml ?
      3) Does the jbossesb.xml file need to be in WEB-INF or the root ?

      I know I'm overlooking something simple but I just can find it.

        • 1. Re: Unable to connect to registry
          kurtstam

          You need to make sure it can read the jbossesb-properties.xml. I think that will get you going.

          • 2. Re: Unable to connect to registry
            gwstern

            OK, I did some more digging around and the problem is centered around the registry - anytime I do anything with the registry it fails:

            Registry registry = RegistryFactory.getRegistry (); // works
            System.out.println ("dump="+registry.toString()); // works
            System.out.println ("services="+registry.findAllServices ()); // fails
            toEPR = (JMSEpr)registry.findEPR (serviceCategoryName, serviceName); //fails
            

            I haven't changed anything that was installed by JBoss ESB although I did play around with jbossesb-properties.xml. I tried MySQL and HSQL but got the same errors.

            I downloaded the UDDI browser from uddibrowser.org and I do get stuff back from JUDDI although it has trouble understanding the format.

            I've read through the Registry Service document and seem to be doing everything correctly (famous last words :-)

            So my question now is - how do I setup/debug the registry ?

            • 3. Re: Unable to connect to registry
              kurtstam

              Well after reading the registry service doc there is nothing much I can add, but you can check out the QuickStarts. The helloword_db_registration and helloworld_db_embbeded may have what you're looking for.

              You can turn up logging for org.apache.juddi and org.apache.scout in log4j. Is juddi finding the juddi.properties file? And have you configured the right db setttings?

              --Kurt

              • 4. Re: Unable to connect to registry
                gwstern

                I cranked up the logging to DEBUG for org.apache and found no juddi or registry errors. In fact, I found nothing about loading/unloading jboss-properties.xml.

                As an aside, do I need jbossesb-gateway.xml & jbossesb-listener.xml ? I only have jbossesb.xml in WEB-INF in one of my jars.

                Also, do I need to manually start the listeners - i.e. via StandAloneBootStrapper ?

                Still puzzled,
                Greg Sternberg

                • 5. Re: Unable to connect to registry
                  kurtstam

                  hi Greg,

                  Take a deep breath :). Now.. Ready? ;)

                  The jbossesb-properties defines which JAXR implementation to use and which XML registry it should be talking to. The error you first encountered tells me it is not finding the the jbossesb-properties file, as it is trying to invoke a class by the name of "null".

                  So, what can we do about that? Are you running with the standalone bootstrapper? Then make sure this file is in the same directory as you are launching the bootstrapper (see the Quickstarts). If you are running inside of the appserver then the installation should have put this file in the server/default/conf directory.


                  As an aside, do I need jbossesb-gateway.xml & jbossesb-listener.xml ? I only have jbossesb.xml in WEB-INF in one of my jars.

                  Also, do I need to manually start the listeners - i.e. via StandAloneBootStrapper ?


                  The gateway and listener files will be generated from your jbossesb.xml. Hopefully someday soon we no longer have to do this but for this is the way it works. The bootstrapper will take care of launching it all.

                  Cheers,

                  --Kurt

                  • 6. Re: Unable to connect to registry
                    gwstern

                    Hmm,

                    (I'm going to take the lazy way out and ask instead of trying :-)

                    So if I understand correctly I need to do the following:
                    1) Open a window and run StandAloneBootStrapper (which create the jbossesb-gateway.xml & jbossesb->listener.xml files from jbossesb.xml)
                    2) Deploy my service.war into .../deploy
                    3) Deploy my gui.war into ..../deploy
                    4) Bring up JBoss (unless I'm redeploying of course)
                    5) Do gui things

                    Now I do have some empty jbossesb-gateway.xml & jbossesb-listener.xml files in .../conf directory, along with jbossesb.properties and jbossesb.xml files. Does this mean I could:
                    1) Generate the jbossesb-gateway.xml & jbossesb-listener.xml files and put them into .../conf
                    2) Deploy my service.war into .../deploy
                    3) Deploy my gui.war into ..../deploy
                    4) Bring up JBoss (unless I'm redeploying of course)
                    5) Do gui things

                    Or am I still confused ?

                    Thanks,
                    Greg Sternberg

                    • 7. Re: Unable to connect to registry
                      kurtstam

                      It always pays to be lazy.. so if I understand it correctly you'd like to run the entire thing in JBossAS? If so you're life is just became much easier. In the install directory, edit the deployment-properties file to point to your JBoss install, then run ant.

                      This deploys the esb as a sar to JBossAS using hsqldb by default. Now you can deploy your stuff on top of that.

                      Does that make more sense?

                      --Kurt

                      • 8. Re: Unable to connect to registry
                        gwstern

                        I intended to do that when I first install the ESB but just in case I did it again - I still get the same results. I looked at the hsql database and there is stuff in it so it *appears* the database is getting created and populated.

                        FYI,
                        Greg Sternberg

                        • 9. Re: Unable to connect to registry
                          kurtstam

                          In 4.0GA we also have a standalone launcher, to help you getting things in the right place and on the classpath. However if you're going to do standalone you may want to wait till next week when 4.0MP1 gets released, where the standalone option is a mature alternative.

                          I still think your jbossesb-properties.xml is not read, we recently added more logging around this to make it more obvious. If you want to can check out the current code in the 4.0MP1 branch.

                          --Kurt

                          • 10. Re: Unable to connect to registry
                            cjunge

                            I am experiencing the same problem.

                            I get the folowing exception when trying to locate a service in the registry:

                            [org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl] Could not set up a connection to the Registry. Failed to create instance of: null
                            javax.xml.registry.JAXRException: Failed to create instance of: null
                            


                            I installed the ESB as a sar into JBoss AS executing ant on linux. Ant put the jbossesb-properties.xml file in the conf directory but still it doesnt seem to work. I get a NullPointerException when trying to access the registry to locate a service.

                            org.jboss.soa.esb.services.registry.RegistryException
                             at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPR(JAXRRegistryImpl.java:360)
                             at cl.falabella.met.Util.callEndPointWithReturn(Util.java:79)
                             at cl.falabella.met.EsbCallThread.run(EsbCallThread.java:44)
                            Caused by: java.lang.NullPointerException
                             at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findService(JAXRRegistryImpl.java:429)
                             at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPR(JAXRRegistryImpl.java:348)
                             ... 2 more
                            
                            


                            At boot time i get this message:

                            --- MBeans waiting for other MBeans ---
                            ObjectName: jboss.org:service=JuddiRMI
                             State: CONFIGURED
                             I Depend On:
                             jboss.org:service=JBossESBDependencies
                             jboss.jca:service=DataSourceBinding,name=juddiDB
                             Depends On Me:
                             jboss.org:service=ConfigurationController
                            
                            ObjectName: jboss.org:service=ConfigurationController
                             State: CONFIGURED
                             I Depend On:
                             jboss.org:service=JBossESBDependencies
                             jboss.org:service=JuddiRMI
                             jboss.jca:service=DataSourceBinding,name=JBossESBDS
                            
                            --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                            ObjectName: jboss.jca:service=DataSourceBinding,name=juddiDB
                             State: NOTYETINSTALLED
                             Depends On Me:
                             jboss.org:service=JuddiRMI
                            


                            I have configured the JBossESBDS with hsql (it was created during the installation) and juddiDS with mysql (manually created the database following instructions on install/registry directory).

                            Any idea why this cuold be happening?

                            Thanks,
                            Cristian


                            • 11. Re: Unable to connect to registry
                              kurtstam

                              Are you using jbossesb-4.0GA?

                              • 12. Re: Unable to connect to registry
                                cjunge

                                Yes, and jboss-4.0.4.

                                • 13. Re: Unable to connect to registry
                                  kurtstam

                                  You maybe loading the wrong jaxr-api.jar.

                                  Try setting this:
                                  System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");

                                  • 14. Re: Unable to connect to registry
                                    cjunge

                                    Yes, thanks a lot. That worked. But I had to move the juddi.properties file to the jboss-4.0.4/bin folder because the system was not finding it in jboss-4.0.4/server/default/conf. Now I am having trouble invoking the ESB services probably for the same reason. Is it possible that the conf folder is not beeing checked for the jbossesb.xml file? Are these problems realted to the version of jboss I am using?

                                    Thanks.
                                    Cristian

                                    1 2 Previous Next