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

    regardig jboss-beans.xml

    Mohammad Norouzi Novice

      HI

      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"
           name="jboss:service=Naming"
           xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
          ...
           <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"
           name="jboss:type=Service,name=SystemProperties">
          
           <!--
           | 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
          
           </attribute>
          
           -->
          
           </mbean>
          


          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"
             name="jboss.system:service=ServiceBindingManager">
             <attribute name="ServerName">ports-default</attribute>
             <attribute name="StoreURL">file:../server/port-bindings.xml</attribute>
             <attribute name="StoreFactoryClassName">
             org.jboss.services.binding.XMLServicesStoreFactory
             </attribute>
             </mbean>


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

            S,
            ALR

            • 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