4 Replies Latest reply on May 20, 2016 3:14 AM by Vaikunda Jothi

    How to migrate AS5 jboss-services.xml  attribute tag with arbitrary xml fragment to AS7 jboss-services.xml

    Yassine GUEBBAS Newbie

      Hi,

      How to migrate a jboss-services.xml from a Jboss AS5 sar file to a jboss AS7 jboss-services.xml knowing that arbitrary xml fragments are no more valid as "attribute" tag content.
      For Jboss AS5 we can find in "jboss-service_5_0.dtd"  :

      <!ELEMENT attribute ANY>
      whereas we have in jboss-service_7_0.xsd :

      <xs:complexType name="attribute">

              <xs:choice minOccurs="0" maxOccurs="1">

                  <xs:element name="inject" type="inject"/>

                  <xs:element name="value-factory" type="value-factory"/>

              </xs:choice>

              <xs:attribute name="name" type="xs:string" use="required"/>

              <xs:attribute name="replace" type="xs:boolean" use="optional"/>

              <xs:attribute name="trim" type="xs:boolean" use="optional"/>

          </xs:complexType>

       

      Thanks

        • 1. Re: How to migrate AS5 jboss-services.xml  attribute tag with arbitrary xml fragment to AS7 jboss-services.xml
          Tomaz Cerar Master

          you are just stating the facts.

           

          what is the question? even better, what exactly are you trying to migrate that does not work.

          • 2. Re: How to migrate AS5 jboss-services.xml  attribute tag with arbitrary xml fragment to AS7 jboss-services.xml
            Yassine GUEBBAS Newbie

            The question is how to migrate a jboss-services.xml from JBoss AS5 to JBoss AS7 format.

            Here is an example of AS5 valid jboss-services.xml:

            <service>

             

              <mbean code="org.jboss.jmx.adaptor.snmp.trapd.TrapdService"

                     name="jboss.jmx:name=SnmpAgent,service=trapd,type=logger">

                      

                <attribute name="BindAddress">

                 

                   <value-factory bean="ServiceBindingManager" method="getStringBinding"

                        parameter="jboss.jmx:name=SnmpAgent,service=trapd,type=logger"/>

                </attribute>

                      

                <attribute name="Port">

                  

                   <value-factory bean="ServiceBindingManager" method="getIntBinding"

                        parameter="jboss.jmx:name=SnmpAgent,service=trapd,type=logger"/>

                </attribute>

              </mbean>

             

             

              <mbean code="org.jboss.jmx.adaptor.snmp.agent.SnmpAgentService"

                     name="jboss.jmx:name=SnmpAgent,service=snmp,type=adaptor">

               

                <attribute name="RequestHandlerClassName">org.jboss.jmx.adaptor.snmp.agent.RequestHandlerImpl</attribute>  

                <attribute name="RequestHandlerResName">/attributes.xml</attribute>

                <attribute name="TrapFactoryClassName">org.jboss.jmx.adaptor.snmp.agent.TrapFactorySupport</attribute>

                <attribute name="NotificationMapResName">/notifications.xml</attribute>

                <attribute name="ManagersResName">/managers.xml</attribute>

                <attribute name="UsersResName">/users.xml</attribute>

                <attribute name="HeartBeatPeriod">0</attribute>

                <attribute name="BindAddress">

                  

                   <value-factory bean="ServiceBindingManager" method="getStringBinding"

                      parameter="jboss.jmx:name=SnmpAgent,service=snmp,type=adaptor"/>

                </attribute>

                <attribute name="Port">

                 

                   <value-factory bean="ServiceBindingManager" method="getIntBinding"

                      parameter="jboss.jmx:name=SnmpAgent,service=snmp,type=adaptor"/>

                </attribute>

                <attribute name="DynamicSubscriptions">true</attribute>

                <attribute name="WriteCommunity">private</attribute>

               

                <attribute name="SubscriptionList">

                  <subscription-list>

                   

                    <mbean name="jboss.jmx:name=SnmpAgent,service=snmp,type=adaptor">

                      <notification type="jboss.snmp.agent.coldstart"/>

                    </mbean>

                   

                    <mbean name="jboss.jmx:name=SnmpAgent,service=timer,type=heartbeat">

                      <notification type="jboss.snmp.agent.heartbeat"/>

                    </mbean>

                    <mbean name="jboss.cache:service=Cache,config=*">

                     <notification type="org.jboss.cache.ViewChanged"/>

                    </mbean>  

                            

                  </subscription-list>

                </attribute>

                   

                <depends optional-attribute-name="TimerName">

                  <mbean code="javax.management.timer.Timer"

                         name="jboss.jmx:name=SnmpAgent,service=timer,type=heartbeat"/>  

                </depends>

              </mbean>

            </service>

            • 4. Re: How to migrate AS5 jboss-services.xml  attribute tag with arbitrary xml fragment to AS7 jboss-services.xml
              Vaikunda Jothi Newbie

              Below jboss-service.xml is working fine in Jboss6.1 and it is not working in wildfly10

               

              <?xml version="1.0" encoding="UTF-8"?>

              <server>

                <mbean code="test.TestService"

                       name="abc:service=TestService">

                  <depends>jboss.web.deployment:war=/axis2</depends>

                  <attribute name="SubscriptionList">

                    <subscription-list>

                      <mbean name="jboss.system:type=Server">

                        <notification type="org.jboss.system.server.started"/>

                        <notification type="org.jboss.system.server.stopped"/>

                      </mbean>

                    </subscription-list>

                  </attribute>

                </mbean>

              </server>

               

              The attributes <depends> and <attribute name="SubscriptionList"> are creating issues during deployment. Could anybody help me to migrate the above jboss-service.xml to wildfly 10?