Parsing errors on jboss-beans.xml in JBoss 7.1 deployment
yzl00000 Aug 14, 2012 12:35 AMHi,
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:
- <annotation> element within <bean> element
- <bean> element with its children within <set elementClass="org.jboss.services.binding.ServiceBindingMetadata"> element
- 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