3 Replies Latest reply on Aug 14, 2007 1:04 AM by Mohammad Norouzi

    regardig jboss-beans.xml

    Mohammad Norouzi Novice


      because we have to deploy our application in many servers with different specifications and configurations, I need to have an external config file in which I declare simply IP and connection url
      the question is that how can I put these info into a file so jboss-beans.xml read those information because this file currently located in jar file it is difficult to alter the file and create a new jar file for each server

      thank you

        • 1. Re: regardig jboss-beans.xml
          J-C jc Apprentice

          I do that kind of things for JBoss configuration. I use the SystemProperty service.

          In your -service.xml file you can use variable. For example:

          <mbean code="org.jboss.naming.NamingService"
           <attribute name="Port">${port.jnp}</attribute>
          . ..
           <attribute name="BindAddress">${jboss.bind.address}</attribute>
           <attribute name="RmiPort">${port.rmi}</attribute>

          Here I have three variables.

          I configure the SystemPropertyService to read system property from a property file. This service will replace in xml files, variable with property from property file:
          <mbean code="org.jboss.varia.property.SystemPropertiesService"
           | Load properties from each of the given comma seperated URLs-->
           <attribute name="URLList">c:\jboss\server\configuration\ports.properties </attribute>
           | Set raw properties file style properties.
           <attribute name="Properties">
           my.project.property=This is the value of my property
           my.project.anotherProperty=This is the value of my other property

          I use that for all the ports used by my JBoss.

          • 2. Re: regardig jboss-beans.xml
            Andrew Rubinger Master

            I use an alternative approach, using the Service Binding Manager...

            In $JBOSS_HOME/server/[serverName]/conf I have service-bindings.xml (obtained from $JBOSS_HOME/docs/examples/binding-manager/sample-bindings.xml in a new installation), and this is sufficient for 4 configurations of servers. Then, I deploy the Service Binding Manager in an MBean (new binding_manager-service.xml file):

            <mbean code="org.jboss.services.binding.ServiceBindingManager"
             <attribute name="ServerName">ports-default</attribute>
             <attribute name="StoreURL">file:../server/port-bindings.xml</attribute>
             <attribute name="StoreFactoryClassName">

            ...where I can pass in the ServerName specific to each instance I'd like to use.


            • 3. Re: regardig jboss-beans.xml
              Mohammad Norouzi Novice

              thank you all
              but what if I use embedable EJB with Tomcat 5.5 ?
              do you have any solution for that?

              thanks again