9 Replies Latest reply on Jan 31, 2014 5:34 AM by ankitceo2

    Parsing errors on jboss-beans.xml in JBoss 7.1 deployment

    yzl00000

      Hi,

       

      I’m working on migration on my application from JBoss 5 to JBoss 7.1. It’s using jboss-service.xml and some jboss-beans.xml files in JBoss 5. I just read the discussion from https://community.jboss.org/thread/203620 and made some changes to one of jboss-beans.xml files.

       


      Deployment is still failed with following errors:

       

      09:37:40,984 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "bindings-jboss-beans.xml"

      09:37:41,046 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."bindings-jboss-beans.xml".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."bindings-jboss-beans.xml".PARSE: Failed to process phase PARSE of deployment "bindings-jboss-beans.xml"

               at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

               at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

               at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

               at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_33]

               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_33]

               at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017052: Failed to parse POJO xml [ "/C:/devEnv/jboss-as-7.1.1.Final/bin/content/bindings-jboss-beans.xml" ]

               at org.jboss.as.pojo.KernelDeploymentParsingProcessor.parseDescriptor(KernelDeploymentParsingProcessor.java:156)

               at org.jboss.as.pojo.KernelDeploymentParsingProcessor.parseDescriptors(KernelDeploymentParsingProcessor.java:128)

               at org.jboss.as.pojo.KernelDeploymentParsingProcessor.deploy(KernelDeploymentParsingProcessor.java:83)

               at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

               ... 5 more

      09:37:41,093 INFO [org.jboss.as] (MSC service thread 1-2) JBAS015951: Admin console listening on http://127.0.0.1:9990

      09:37:41,093 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "bindings-jboss-beans.xml" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"bindings-jboss-beans.xml\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"bindings-jboss-beans.xml\".PARSE: Failed to process phase PARSE of deployment \"bindings-jboss-beans.xml\""}}

       

       

      I deleted similar settings and attached the fragments that are causing parsing errors.

       

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

      <deployment xmlns="urn:jboss:pojo:7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:pojo:7.0 jboss-pojo_7_0.xsd">

        

           <!-- The actual SBM from which services obtain binding information -->

           <bean name="ServiceBindingManager" class="org.jboss.services.binding.ServiceBindingManager">

                <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.system:service=ServiceBindingManager",exposedInterface=org.jboss.services.binding.ServiceBindingManagerMBean.class, registerDirectly=true)</annotation>

                <!-- Here we use the ServiceBindingManagementObject as a factory to create the SBM -->

                <constructor factory-method="getServiceBindingManager">    

                     <factory bean="ServiceBindingManagementObject"/>

                </constructor>

            </bean>

        

         <!-- Base binding metadata that ServiceBindingStore uses to create bindings for each set -->

         <bean name="StandardBindings" class="java.util.HashSet">

                <constructor>

                     <parameter class="java.util.Collection">

                          <set elementClass="org.jboss.services.binding.ServiceBindingMetadata">

                               <!-- ********************* conf/jboss-service.xml ****************** -->

                               <!-- Naming Service -->

                               <bean class="org.jboss.services.binding.ServiceBindingMetadata">

                                    <property name="serviceName">jboss:service=Naming</property>

                                    <property name="bindingName">Port</property>

                                    <property name="port">1099</property>

                                    <property name="description">The listening socket for the Naming service</property>

                               </bean>

                          </set>

                     </parameter>

                </constructor>

      </bean>

       

           <!-- XSL Transform to apply to server.xml -->

           <bean name="JBossWebConnectorXSLTConfig"

                class="org.jboss.services.binding.impl.XSLTServiceBindingValueSourceConfig">

                <constructor>

                     <parameter><![CDATA[

                <xsl:stylesheet

                     xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>

                <xsl:output method="xml" />

                <xsl:param name="port"/>

                <xsl:variable name="portAJP" select="$port - 71"/>

                <xsl:variable name="portHttps" select="$port + 363"/>

                <xsl:template match="/">

                     <xsl:apply-templates/>

                </xsl:template>

                <xsl:template match = "Connector">

                <Connector>

                     <xsl:for-each select="@*">

                     <xsl:choose>

                          <xsl:when test="(name() = 'port' and . = '8080')">

                                <xsl:attribute name="port"><xsl:value-of select="$port" /></xsl:attribute>

                           </xsl:when>

                           <xsl:when test="(name() = 'port' and . = '8009')">

                                <xsl:attribute name="port"><xsl:value-of select="$portAJP" /></xsl:attribute>

                           </xsl:when>

                           <xsl:when test="(name() = 'redirectPort')">

                                <xsl:attribute name="redirectPort"><xsl:value-of select="$portHttps" /></xsl:attribute>

                           </xsl:when>

                           <xsl:when test="(name() = 'port' and . = '8443')">

                                <xsl:attribute name="port"><xsl:value-of select="$portHttps" /></xsl:attribute>

                           </xsl:when>

                           <xsl:otherwise>

                                <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>

                           </xsl:otherwise>

                      </xsl:choose>

                      </xsl:for-each>

                      <xsl:apply-templates/>

                 </Connector>

            </xsl:template>

            <xsl:template match="*|@*">

                 <xsl:copy>

                      <xsl:apply-templates select="@*|node()"/>

                 </xsl:copy>

           </xsl:template>

            </xsl:stylesheet>

              ]]>

                      </parameter>

                 </constructor>

            </bean>

       

      </deployment>

       

       

      If I remove following elements, parsing error will never happen:

      1. <annotation> element within <bean> element
      2. <bean> element with its children within <set elementClass="org.jboss.services.binding.ServiceBindingMetadata"> element
      3. CDATA content within <parameter> element

       

      I have reviewed schema there  but have no idea how to modify/migrate the elements. Do you have any clue on this migration?

       

      Thanks,

      David

        • 1. Re: Parsing errors on jboss-beans.xml in JBoss 7.1 deployment
          alesj
          1. <annotation> element within <bean> element

          <annotation> is not supported any more.

           

          1. <bean> element with its children within <set elementClass="org.jboss.services.binding.ServiceBindingMetadata"> element

          I would need to check for nested beans.

           

          1. CDATA content within <parameter> element

          This might be an oversight while porting.

          • 2. Re: Parsing errors on jboss-beans.xml in JBoss 7.1 deployment
            yzl00000

            Hi,

             

            Thanks for the reply and fixing the issue quickly.

            If I cannot use <annotation> within <bean>, do you mean I can completely ignore this element or there is a new format to include it?

            Could you please give more details how to resolve them if they are not supported?

             

            Thanks,

            David

            • 3. Re: Parsing errors on jboss-beans.xml in JBoss 7.1 deployment
              alesj

              If I cannot use <annotation> within <bean>, do you mean I can completely ignore this element or there is a new format to include it?

              Could you please give more details how to resolve them if they are not supported?

              <annotation> is actually a huge feature in AS5/6, with a lot of code behind it etc.

              Probably even over engineered. ;-)

              Without going into too much and too many details, I can just say it's beyond the scope of portability to actually re-implement all of this on top of MSC and AS7.

               

              In this case, @JMX, all it does it registers this bean into MBeanServer.

              I'm sure you can easily add this behavior with some custom JMX helper class.

               

              If you don't need this bean to be registered in MBeanServer, you can simply ignore/remove the <annotation> element.

               

              Otoh, perhaps an interesting contribution ;-) would be to support beans being registered as mbeans.

              e.g. instead of <annotation>, there would be some <jmx> element

              1 of 1 people found this helpful
              • 4. Re: Parsing errors on jboss-beans.xml in JBoss 7.1 deployment
                ankitceo2

                Hi Ales,

                           I am having the same errors also with my -beans.xml files. In that if I remove the nested <bean>...<bean>.. </bean> ... </bean> reference, it works for me on JBoss AS7.1.1 . But I was wondering if that nesting is no longer valid, how can we add the same "nesting of beans"?  I mean can it be removed completely or can it be replaced with a different syntax. And also if I use jboss-app.xml the deployment is throwing error as raised in a thread Problem with deployoing ear on JBoss AS7 while it worked on AS5. In case I do not use it. It says the error as mentioned in the title of this thread. Following is the structure of my jboss-beans.xml file.

                 

                ======================================================================================

                jboss-beans.xml

                ======================================================================================

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

                <deployment xmlns="urn:jboss:bean-deployer:2.0">

                 

                    <bean name="ServicesCacheConfig" class="org.jboss.cache.config.Configuration">

                 

                        <property name="runtimeConfig">

                            <bean name="RuntimeConfig" class="org.jboss.cache.config.RuntimeConfig">

                            <!--

                                <property name="transactionManager">

                                    <inject bean="TransactionManager" property="transactionManager"/>

                                </property>

                            -->

                            </bean>

                        </property>

                   

                        <property name="cacheMode">LOCAL</property>

                        <property name="lockAcquisitionTimeout">15000</property>

                        <property name="isolationLevel">REPEATABLE_READ</property>

                 

                         <!-- EJBs use JBoss Cache eviction -->

                        <property name="evictionConfig">

                             <bean name="EvictionPolicy" class="org.jboss.cache.config.EvictionConfig">

                                <property name="wakeupInterval">15000</property>

                                <property name="defaultEvictionRegionConfig">

                                    <bean class="org.jboss.cache.config.EvictionRegionConfig">

                                        <property name="regionName">/</property>

                                        <property name="evictionAlgorithmConfig">

                                            <bean class="org.jboss.cache.eviction.LRUAlgorithmConfig">

                                                <property name="maxNodes">20000</property>

                                                <property name="timeToLive">-1</property>

                                                <property name="minTimeToLive">0</property>

                                            </bean>

                                        </property>

                                    </bean>

                                </property>

                                <property name="evictionRegionConfigs">

                                    <list>

                                       

                                        <bean class="org.jboss.cache.config.EvictionRegionConfig">

                                            <property name="regionName">/nxmim</property>

                                            <property name="evictionAlgorithmConfig">

                                                <bean class="org.jboss.cache.eviction.LRUAlgorithmConfig">

                                                    <property name="maxNodes">-1</property>

                                                    <property name="timeToLive">-1</property>

                                                    <property name="minTimeToLive">0</property>

                                                </bean>

                                            </property>

                                        </bean>

                                       

                                        <bean class="org.jboss.cache.config.EvictionRegionConfig">

                                            <property name="regionName">/nxmo/inst/NxCategory</property>

                                            <property name="evictionAlgorithmConfig">

                                                <bean class="org.jboss.cache.eviction.LRUAlgorithmConfig">

                                                    <property name="maxNodes">-1</property>

                                                    <property name="timeToLive">-1</property>

                                                    <property name="minTimeToLive">0</property>

                                                </bean>

                                            </property>

                                        </bean>

                                       

                                    </list>

                                </property>

                            </bean>

                        </property>

                 

                    </bean>

                   

                    <bean name="ServicesPojoCacheMBean" class="org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper">

                       

                        <property name="configuration"><inject bean="ServicesCacheConfig" /></property>

                    </bean>

                 

                </deployment>

                ===============================================================================================

                 

                Please help me with a reply.

                • 5. Re: Parsing errors on jboss-beans.xml in JBoss 7.1 deployment
                  alesj

                  You can always move inner beans to top level,

                  and then simply reference them via inject.

                   

                  Nested beans is just bit shorter syntax for this.

                  • 6. Re: Parsing errors on jboss-beans.xml in JBoss 7.1 deployment
                    ankitceo2

                    Ok. Thanks a lot Ales.

                    • 7. Re: Parsing errors on jboss-beans.xml in JBoss 7.1 deployment
                      ankitceo2

                      Hi Ales,

                                  I am stuck with the deployment of an ear containing jboss-app.xml. In the presence of this descriptor the JBoss AS7.1 gives an exception saying

                      "Error can not open zip file". The same concern has been raised in a thread with  the URL "Error while deploying in JBoss AS7 with jboss-app.xml.". But if I remove this jboss-app.xml file and then try the deployment it deploys without any error. But that case some part of the EAR becomes unusable. The following is the structure of jboss-app.xml used in the EAR.

                       

                      =======================================================

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

                      <!DOCTYPE jboss-app

                              PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"

                              "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd">

                      <jboss-app>

                          <loader-repository>

                              com.osi:archive=nxservices

                          </loader-repository>

                          <module>

                              <service>osi-topics-service.xml</service>

                          </module>

                          <module>

                              <service>osi-properties-service.xml</service>

                          </module>

                          <module>

                              <service>dmpjca-ds.xml</service>

                          </module>

                          <module>

                              <service>osi-tt-config-service.xml</service>

                          </module>

                      </jboss-app>

                      ===========================================================

                       

                      Please help me with what is wrong with the structure of this jboss-ap.xml file.

                       

                      Thanks

                      Ankit

                      • 8. Re: Parsing errors on jboss-beans.xml in JBoss 7.1 deployment
                        alesj

                        This has nothing to do with the initial topic.

                        I suggest you move this question to the right place.

                        btw: this jboss-app.xml looks old, intended for JBossAS4.2

                        • 9. Re: Parsing errors on jboss-beans.xml in JBoss 7.1 deployment
                          ankitceo2

                          Thanks Ales.

                                             Actually I have a question raised in this regard at https://community.jboss.org/thread/236654. Please hellp me write a proper jbosss-app.xml file.

                           

                          Thanks a lot

                          ANkit