7 Replies Latest reply on Apr 17, 2010 4:05 AM by franky_b

    ESB remote invoking from different AS

      Hi,

       

      We have currently a setup, where under one JBoss AS there is an ESB project, and a Seam project. We can access the ESB methods with the ServiceInvoker. We would like to separate these project into different AS-es, running in different machines. However, we can't find any tutorial, configuration example, or something that we could start out with, on how to call the ESB methods from a different AS.

       

      We are using jboss-5.1.0.GA and jbossesb-4.6.

       

      According to the Programmers Guide, we need a set of jars and the jbossesb-properties.xml in the classpath. However, it is not detailed, what to set up in that XML. Is there any example, or tutorial for this? I'm stuck with googling.

       

      Thanks in advance

        • 1. Re: ESB remote invoking from different AS
          hauch

          One way to obtaining this would be to let the servers share juddi.

          In this scenario the service invoker will be able to invoker services on other servers.

           

          To do this let the servers use the same database - configured in jbossesb.sar/juddi-ds.xml

          • 2. Re: ESB remote invoking from different AS
            ryanhos

            This is really no different from setting up an external client, in the same manner as the quickstart tutorials.  IIRC, many of them boot the server then invoke some client in a separate VM, which uses the ServiceInvoker to deliver the message to the ESB.  You need to expose JUDDI so that it can be queried from outside the AS via a webservice(I think it comes out of the box like this, actually).  Then you need to setup the client to use the org.apache.ws.scout.transport.AxisTransport via the client's jbossesb-properties.xml file.  Having them share the JUDDI DB is a bad idea due to concurrency concerns, in my opinion, and probably won't work well in development where each developer's JBoss may be using Hypersonic (w/out TCP listeners) for the JUDDI persistence.

             

            My suggestion is to start with a custom client jboss-esb-properties.xml file (set the AxisTransport and accompanying properties) and add JARs from deployers/esb.deployer/lib to the classpath.  This will bloat your classpath, but once you have it working, you can pare-out all of the unnecessary items like milyn.

             

            Don't forget to set this once in your client JVM, either by the code shown here, -D on the command line, or by properties-service.xml

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

             

            This sort of leads me to wonder why there is not a jbossesb-client.jar, in the style of $JBOSS_hOME%/client/jbossall-client.jar which includes all necessary classes for communicating with an ESB outside the app container.

            • 3. Re: ESB remote invoking from different AS
              derekchudley

              Hi,

               

              Try this jbossesb-properties.xml - change localhost to your remote AS address.

               

              <?xml version="1.0" encoding="ISO-8859-1"?>

              <!--

                JBoss, Home of Professional Open Source

                Copyright 2006, JBoss Inc., and others contributors as indicated

                by the @authors tag. All rights reserved.

                See the copyright.txt in the distribution for a

                full listing of individual contributors.

                This copyrighted material is made available to anyone wishing to use,

                modify, copy, or redistribute it subject to the terms and conditions

                of the GNU Lesser General Public License, v. 2.1.

                This program is distributed in the hope that it will be useful, but WITHOUT A

                WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A

                PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.

                You should have received a copy of the GNU Lesser General Public License,

                v.2.1 along with this distribution; if not, write to the Free Software

                Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,

                MA  02110-1301, USA.

               

                (C) 2005-2006,

                @author JBoss Inc.

              -->

              <!-- $Id: jbossesb-unittest-properties.xml $ -->

              <!--

                These options are described in the JBossESB manual.

                Defaults are provided here for convenience only.

               

                Please read through this file prior to using the system, and consider

                updating the specified entries.

              -->

              <esb

                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">

                  <properties name="core">

              <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>

              <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>

              <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>

                      <property name="jboss.esb.invm.scope.default" value="GLOBAL"/>

                  </properties>

                  <properties name="registry">     

                  <property name="org.jboss.soa.esb.registry.queryManagerURI"    

                  value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>   

                  <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"    

                  value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />

                  <property name="org.jboss.soa.esb.registry.implementationClass"

                  value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>

                  <property name="org.jboss.soa.esb.registry.factoryClass"

                  value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>

                  <property name="org.jboss.soa.esb.registry.user"

                  value="jbossesb"/>

                  <property name="org.jboss.soa.esb.registry.password"

                    value="password"/>

                  <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->

                  <property name="org.jboss.soa.esb.scout.proxy.transportClass"

                  value="org.apache.ws.scout.transport.RMITransport"/>

                  </properties>

                  <properties name="transports" depends="core">

                  <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>

                  <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>

                  <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>

                  <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>

                  </properties>

                  <properties name="connection">

                  <property name="min-pool-size" value="5"/>

                  <property name="max-pool=size" value="10"/>

                  <property name="blocking-timeout-millis" value="5000"/>

                  <property name="abandoned-connection-timeout" value="10000"/>

                  <property name="abandoned-connection-time-interval" value="30000"/>

                  </properties>

                  <properties name="dbstore">

              <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>

              <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>

              <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>

              <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>

              <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>

              <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>

              <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>

              <!--table managed by pool to test for valid connections - created by pool automatically -->

              <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>

              <!-- # of milliseconds to timeout waiting for a connection from pool -->

              <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>

                              <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>

                  </properties>

                  <properties name="messagerouting">

                  <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>

                  </properties>

              </esb>

              • 4. Re: ESB remote invoking from different AS
                cdelgado70

                Hi Derek,

                 

                I am using your jbossesb-properties.xml, but I am getting this exception:

                 

                Exception in thread "main" org.jboss.soa.esb.listeners.message.MessageDeliverException: org.apache.ws.scout.transport.TransportException: javax.naming.NameNotFoundException: InquiryService not bound
                    at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:545)
                    at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:174)
                    at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:155)
                    at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:197)
                    at org.jboss.soa.esb.samples.quickstarts.bpm_orchestration4.test.SendEsbStartMessage.main(SendEsbStartMessage.java:58)
                Caused by: org.jboss.soa.esb.services.registry.RegistryException: org.apache.ws.scout.transport.TransportException: javax.naming.NameNotFoundException: InquiryService not bound
                    at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:348)
                    at org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor.findEPRs(InVMRegistryInterceptor.java:85)
                    at org.jboss.soa.esb.services.registry.RegistryFactory$HeadRegistryInterceptor.findEPRs(RegistryFactory.java:229)
                    at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:226)
                    at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:532)
                    ... 4 more
                Caused by: javax.xml.registry.JAXRException: org.apache.ws.scout.transport.TransportException: javax.naming.NameNotFoundException: InquiryService not bound
                    at org.apache.ws.scout.registry.BusinessQueryManagerImpl.findConcepts(BusinessQueryManagerImpl.java:544)
                    at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.getJBossESBTModel(JAXRRegistryImpl.java:653)
                    at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:307)
                    ... 8 more

                 

                So I went to Jboss's jmx-console in particular to Global JNDI Namespace, and I found:

                  +- juddiv3 (class: org.jnp.interfaces.NamingContext)
                  |   +- UDDIPublicationService (class: org.apache.juddi.rmi.UDDIPublicationService)
                  |   +- UDDICustodyTransferService (class: org.apache.juddi.rmi.UDDICustodyTransferService)
                  |   +- UDDISubscriptionListenerService (class: org.apache.juddi.rmi.UDDISubscriptionListenerService)
                  |   +- UDDISecurityService (class: org.apache.juddi.rmi.UDDISecurityService)
                  |   +- JUDDIApiService (class: org.apache.juddi.rmi.JUDDIApiService)
                  |   +- UDDISubscriptionService (class: org.apache.juddi.rmi.UDDISubscriptionService)
                  |   +- UDDIInquiryService (class: org.apache.juddi.rmi.UDDIInquiryService)


                These are different to the services in your jbossesb-properties.xml. This might explain the InquiryService not bound message in the exception.
                After replacing the InquiryService for the one shown in my JNDI, I've got inquire method not found error. I am using jbossesb-server-4.7, and it seems other things are required to successfully access the UDDI via RMI.
                Help will be much appreciated.


                • 5. Re: ESB remote invoking from different AS
                  franky_b

                  Hi,

                   

                  I have exactly the same problem. When I change the InquiryService to the one that matches my JNDI entry (juddiv3/UDDIInquiryService) I get a NullPointerException:

                   

                  Caused by: org.jboss.soa.esb.services.registry.RegistryException: org.apache.ws.scout.transport.TransportException: java.lang.NullPointerException
                          at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:348)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:597)
                          at org.jboss.internal.soa.esb.services.registry.RegistryService$1.invoke(RegistryService.java:61)
                          at $Proxy358.findEPRs(Unknown Source)
                          at org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor.findEPRs(InVMRegistryInterceptor.java:85)
                          at org.jboss.soa.esb.services.registry.RegistryFactory$HeadRegistryInterceptor.findEPRs(RegistryFactory.java:229)
                          at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:226)
                          at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:532)
                          ... 136 more
                  Caused by: javax.xml.registry.JAXRException: org.apache.ws.scout.transport.TransportException: java.lang.NullPointerException
                          at org.apache.ws.scout.registry.BusinessQueryManagerImpl.findConcepts(BusinessQueryManagerImpl.java:544)
                          at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.getJBossESBTModel(JAXRRegistryImpl.java:653)
                          at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:307)
                          ... 146 more

                   

                   

                  Edit: The NullPointerException occurs if I omit the request parameter (?org.apache.juddi.registry.rmi.Inquiry#inquire) in the URL. If I fill it in, I get a ClassNotFoundException for org.apache.juddi.registry.rmi.Inquiry instead.

                   

                   

                  Is there a solution for this problem?

                  How did you fix it?

                   

                  Thanks!

                  Frank

                  • 6. Re: ESB remote invoking from different AS

                    configuration for remote ServiceInvoker.

                    hope this can help..

                    these are my working project settings :

                     

                    include jars :

                    • commons-codec-1.3.jar
                      commons-collections.jar
                      commons-configuration-1.5.jar
                      commons-lang-2.3.jar
                      commons-logging-1.1.jar
                      javassist-3.6.0.GA.jar
                      jboss-aop-jdk50-1.5.6.GA.jar
                      jboss-javaee.jar
                      jboss-messaging-client.jar
                      jboss-remoting.jar
                      jbossall-client.jar
                      jbossesb-config-model-1.2.0.jar
                      jbossesb-rosetta.jar
                      jbossts-common.jar
                      juddi-client-3.0.0.aop.jar
                      juddi-core-3.0.0.jar
                      log4j-1.2.14.jar
                      rosetta.aop
                      scout-1.2.aop.jar
                      stax-1.2.0.jar
                      stax-api-1.0.1.jar
                      trove.jar
                      uddi-ws-3.0.0.jar
                      wstx-asl-3.2.0.jar
                      xbean-2.2.0.jar
                      xercesImpl-2.8.0.jar

                     

                    include these in classpath :

                    • META-INF/uddi.xml    --> copied from jbossesb-4.7\samples\quickstarts\conf\registry
                    • jbossesb-properties.xml   --> copied from jbossesb-4.7\samples\quickstarts\helloworld
                    • jndi.properties --> copied from jbossesb-4.7\samples\quickstarts\helloworld
                    • log4j.xml   -->  copied from jbossesb-4.7\samples\quickstarts\helloworld
                    • 7. Re: ESB remote invoking from different AS
                      franky_b

                      Well, I finally got it working now!

                       

                      The trick is to set everything to "LocalTransport" in the jbossesb-properties.xml. Then, you have to provide a second config file META-INF/uddi.xml. In this file, you can specify the RMI transport settings. This seems to work with juddi-client 3.0.1 .