12 Replies Latest reply on Sep 28, 2007 10:43 AM by Kevin Conner

    ESB and AS starting on the same machine

    Per Nyfelt Newbie

      I'd like to get the ESB to be able to start on the same machine as where a Jboss AS is running and are trying to change the ports on the ESB to make this possible. There are some ports that I fail to find a configuration for however. 3873 is the one i am currently trying to track down. Is there a description for what files to edit to make two Jboss instances run on the same server somewhere?

      FYI here the relevent conslose output:
      09:52:27,794 INFO [ServerInfo] OS-System: Linux 2.6.21.3,i386
      09:52:28,536 INFO [Server] Core system initialized
      09:52:29,781 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
      09:52:31,141 ERROR [SocketServerInvoker] Error starting ServerSocket. Bind port: 3873, bind address: /127.0.0.1
      09:52:31,143 ERROR [Connector] Error starting connector.
      java.net.BindException: Address already in use

      Best regards,
      Per

        • 1. Re: ESB and AS starting on the same machine
          Mark Little Master

          Any particular reason you're not deploying the ESB into JBossAS?

          • 2. Re: ESB and AS starting on the same machine
            Per Nyfelt Newbie

            Sorry, maybe i was not clear in the post. Yes the ESB is running JBossAS. In real test (and later in production) the ESB and the AS reside on separate physical machines. For a development environment i want all servers to run on my local PC so hence the need to be able to start one instance of JBoss (AS) as wehere the EJB's etc are deployed to and another instance of Jboss (ESB) where the services are published for the GUI apps and integrating with the EJB's running on the AS instance. For this to be possible i need to edit port information so both instances can start up.

            • 3. Re: ESB and AS starting on the same machine
              Kurt Stam Master

              Use the jboss-bindings.xml.

              --Kurt

              • 4. Re: ESB and AS starting on the same machine
                Per Nyfelt Newbie

                Thank you! With your hint i found a page on the wiki that helped me resolve the issue: http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfiguringMultipleJBossInstancesOnOneMachine

                • 6. Re: ESB and AS starting on the same machine
                  Rafael Codina Tormo Newbie

                  Hi,

                  I am using JBossesb-4.0GA on JBossAS-4.0.4GA and I am trying to run several instances of both AS and ESB on the same machine.

                  I have followed the bugs:

                  http://jira.jboss.com/jira/browse/JBESB-635
                  as well as
                  http://jira.jboss.com/jira/browse/JBESB-507

                  I have properly modified the conf/jboss-service.xml file to use the ServiceBindingManager. Particularly, the only thing that changes is the binding Port for the Naming Service(2099 instead of the default 1099).

                  I have also configured the files conf/juddi.properties and conf/jndi.properties for them to have the reference to the same port:

                  java.naming.provider.url=jnp://localhost:2099


                  My problem is that when I start the server, I got the following exception

                  2007-09-27 12:30:48,074 INFO [org.jboss.internal.soa.esb.dependencies.JuddiRMIService] (main) starting juddi RMI service
                  2007-09-27 12:30:48,084 DEBUG [org.apache.juddi.registry.rmi.JNDIRegistration] (main) Creating Initial Context using:
                  java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
                  java.naming.provider.url=jnp://localhost:1099
                  java.naming.factory.url.pkgs=org.jboss.naming
                  
                  2007-09-27 12:30:48,094 DEBUG [org.apache.juddi.registry.rmi.JNDIRegistration] (main) Setting /InquiryService, org.apache.juddi.registry.rmi.InquiryService
                  2007-09-27 12:30:49,105 DEBUG [org.jnp.interfaces.NamingContext] (main) Failed to connect to localhost:1099
                  javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
                   at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
                   at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
                   at org.jnp.interfaces.NamingContext.bind(NamingContext.java:538)
                   at org.jnp.interfaces.NamingContext.bind(NamingContext.java:531)
                   at javax.naming.InitialContext.bind(InitialContext.java:359)
                   at org.apache.juddi.registry.rmi.JNDIRegistration.register(JNDIRegistration.java:78)
                   at org.jboss.internal.soa.esb.dependencies.JuddiRMIService.startService(JuddiRMIService.java:23)
                   at org.jboss.system.ServiceMBeanS
                  


                  This exception is already mentioned in the bug:
                  http://jira.jboss.com/jira/browse/JBESB-507

                  and the values taken by the JNDIRegistration class are those by default since the juddi.properties is still not deployed, which means also that the configuration of the ServiceBindingManager has not been taken into account.

                  Do you have any suggestions to solve this problem?



                  • 7. Re: ESB and AS starting on the same machine
                    Kevin Conner Master

                    JBossESB 4.2.1 will be the first released version which will work cleanly with ServiceBindingManager.

                    2007-09-27 12:30:48,084 DEBUG [org.apache.juddi.registry.rmi.JNDIRegistration] (main) Creating Initial Context using:
                    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
                    java.naming.provider.url=jnp://localhost:1099
                    java.naming.factory.url.pkgs=org.jboss.naming

                    As for your specific issue, it looks like the java.naming.provider.url property was not updated in the juddi properties file used by the ESB.

                    • 8. Re: ESB and AS starting on the same machine
                      Rafael Codina Tormo Newbie

                      Actually it is, but the deployment of the juddi.properties is performed after the execution of the class:


                      org.jboss.internal.soa.esb.dependencies.JuddiRMIService

                      In the same log file we can check:

                      2007-09-27 12:31:00,301 DEBUG [org.apache.juddi.registry.local.Registry] (main) Loading jUDDI configuration.
                      2007-09-27 12:31:00,301 DEBUG [org.apache.juddi.util.Loader] (main) Trying to find [D:\XX\Jboss\server\XX\conf/juddi.properties] using context classloader org.jboss.mx.loading.UnifiedClassLoader3@e72f0c{ url=file:/D:/XX/Jboss/server/XX/deploy/jbossesb.sar/ ,addedOrder=13}.
                      2007-09-27 12:31:00,342 DEBUG [org.apache.juddi.util.Loader] (main) Trying to find [D:\XXJboss\server\XX\conf/juddi.properties] using org.jboss.mx.loading.UnifiedClassLoader3@1e6743e{ url=file:/D:/XX/Jboss/server/XX/deploy/jbossesb-dependencies.sar/ ,addedOrder=12} class loader.
                      2007-09-27 12:31:00,342 DEBUG [org.apache.juddi.util.Loader] (main) Trying to find [D:\XX\Jboss\server\XX\conf/juddi.properties] using ClassLoader.getSystemResource().
                      


                      This is due to the dependencies between the different MBeans defined in deploy/jbossesb.sar/META-INF/jboss-service.xml:

                      <mbean code="org.jboss.soa.esb.listeners.config.ConfigurationControllerService"
                       name="jboss.org:service=ConfigurationController"
                       description="Configuration controller which generated the config files for the listener and gateway controllers">
                       <attribute name="ConfigurationFile">jbossesb.xml</attribute>
                       <depends>jboss.org:service=JBossESBDependencies</depends>
                       <depends>jboss.org:service=JuddiRMI</depends>
                       <depends>jboss.jca:service=DataSourceBinding,name=JBossESBDS</depends>
                      
                       </mbean>
                      


                      and in deploy/jbossesb-dependencies.sar/META-INF/jboss-service.xml:

                      <server>
                       <mbean code="org.jboss.internal.soa.esb.dependencies.JBossESBDependenciesService"
                       name="jboss.org:service=JBossESBDependencies"
                       description="Container for the JBossESB Dependencies">
                      
                       </mbean>
                      
                      
                       <!-- Registers the Juddi RMI Service to JNDI -->
                      
                       <mbean code="org.jboss.internal.soa.esb.dependencies.JuddiRMIService"
                       name="jboss.org:service=JuddiRMI" description="Juddi RMI Service">
                       <depends>jboss.org:service=JBossESBDependencies</depends>
                       <depends>jboss.jca:service=DataSourceBinding,name=juddiDB</depends>
                       </mbean>
                      </server>
                      


                      As shown in the configuration, the validation of the file jbossesb.xml + deployment of the juddi.properties is achieved after the deployment of the jboss.org:service=JuddiRMI due to the dependencies between the two MBeans.

                      I have tried to launch JBoss with different dependencies to solve this problem, but always without success.

                      Any ideas of how to deploy conf/juddi.properties at the beginning of the deployment task?

                      Thank you.

                      • 9. Re: ESB and AS starting on the same machine
                        Kevin Conner Master

                         

                        "ctormo" wrote:
                        Actually it is, but the deployment of the juddi.properties is performed after the execution of the class:


                        The juddi configuration file is not deployed so the mbean dependencies are irrelevant. Why are you using 4.0GA in any case?

                        • 10. Re: ESB and AS starting on the same machine
                          Rafael Codina Tormo Newbie

                          Version 4.0GA is being used because the project I am working in started when that version had just been released.


                          How can I, then, deploy the juddi.properties before the JuddiRMIService class is deployed in order to have the right values for:

                          java.naming.factory.initial
                          java.naming.provider.url
                          java.naming.factory.url.pkgs

                          instead of those by default?

                          • 11. Re: ESB and AS starting on the same machine
                            Rafael Codina Tormo Newbie

                            I have added the juddi.properties file into the attribute URLList of the MBean jboss:type=Service,name=SystemProperties.

                            Then I have added to my "Juddi RMI Service" a depends clause for him to depend on the "jboss:type=Service,name=SystemProperties".

                            Even with this dependency, I am obtaining the default values for the properties
                            java.naming.factory.initial
                            java.naming.provider.url
                            java.naming.factory.url.pkgs

                            During my debug tests I have realised that in the org.apache.juddi.util.Config class, for the method

                             public static String getStringProperty(String key, String defaultValue)
                             {
                             String stringVal = defaultValue;
                            
                             String propValue = getStringProperty(key);
                             if(propValue != null)
                             stringVal = propValue;
                            
                             return stringVal;
                             }
                            


                            the propValue variable is null, since the config variable is null for the first call of the String getStringProperty(String key) method, which forces the call to the createConfig() method:

                            public static String getStringProperty(String key)
                             {
                            
                             if(config == null)
                             config = createConfig();
                            
                            
                             if(config == null)
                             return null;
                            
                            
                             if(key == null)
                             return null;
                            
                             else return config.getProperty(key);
                             }
                            
                            



                            The call to the Config.addProperties(Properties props) is performed during the validation of the jbossesb.xml file (deployment of the jboss.org:service=ConfigurationController).

                            Any suggestions of how this can be solved?

                            Thanks





                            • 12. Re: ESB and AS starting on the same machine
                              Kevin Conner Master

                               

                              "ctormo" wrote:
                              I have added the juddi.properties file into the attribute URLList of the MBean jboss:type=Service,name=SystemProperties.

                              Please stop playing around with dependencies, the juddi.properties file does not get deployed in 4.0GA.

                              Please send me a copy of your boot.log/server.log files and I will see if there is anything obvious.