Not a textual event (START_ELEMENT) Errors while migrating SAR service to JBoss EAP 6.x

Solution Verified - Updated -

Issue

  • Migrating from JBoss EAP 4.2 and having a sar service similar to the following:
<server>
  <classpath codebase="ourlibs" archives="customlogic.jar"/>
  <mbean code="somepackage.OurService"
         name="somepackage:service=OurService">
    <depends>jboss:service=invoker,type=jrmp</depends>
  </mbean>
</server>
  • The sar implementation has a custom logic and uses classes from customlogic.jar as well:
public class OurService extends ServiceMBeanSupport implements OurServiceMBean {
 ...
  public void startService() throws Exception  {
    super.startService();
    //custom logic
  • At section 3.2.7.1 of admin guide, it says most of .sar services are supported. So, how to migrate this sar so that it can be deployed?

  • Tried to deploy it and it throw following errors:

INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "OurService.sar"
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit."OurService.sar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."OurService.sar".PARSE: JBAS018733: Failed to process phase PARSE of deployment "OurService.sar"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
        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: JBAS017224: Failed to parse service xml ["/content/OurService.sar/META-INF/jboss-service.xml"]
        at org.jboss.as.service.ServiceDeploymentParsingProcessor.deploy(ServiceDeploymentParsingProcessor.java:102)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
        ... 5 more
Caused by: java.lang.IllegalStateException: Not a textual event (START_ELEMENT)
        at com.ctc.wstx.sr.BasicStreamReader.throwNotTextual(BasicStreamReader.java:5444)
        at com.ctc.wstx.sr.BasicStreamReader.getText(BasicStreamReader.java:833)
        at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.getText(XMLExtendedStreamReaderImpl.java:275) [staxmapper-1.1.0.Final-redhat-1.jar:1.1.0.Final-redhat-1]
        at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.unexpectedContent(JBossServiceXmlDescriptorParser.java:629)
        at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.readElement(JBossServiceXmlDescriptorParser.java:193)
        at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.readElement(JBossServiceXmlDescriptorParser.java:47)
        at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final-redhat-1.jar:1.1.0.Final-redhat-1]
        at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.1.0.Final-redhat-1.jar:1.1.0.Final-redhat-1]
        at org.jboss.as.service.ServiceDeploymentParsingProcessor.deploy(ServiceDeploymentParsingProcessor.java:95)
        ... 6 more

INFO  [org.jboss.as.server] (host-controller-connection-threads - 1) JBAS015870: Deploy of deployment "OurService.sar" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"OurService.sar\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"OurService.sar\".PARSE: JBAS018733: Failed to process phase PARSE of deployment \"OurService.sar\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017224: Failed to parse service xml [\"/content/OurService.sar/META-INF/jboss-service.xml\"]
    Caused by: java.lang.IllegalStateException: Not a textual event (START_ELEMENT)"}}
INFO  [org.jboss.as.controller] (host-controller-connection-threads - 1) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.deployment.unit."OurService.sar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."OurService.sar".PARSE: JBAS018733: Failed to process phase PARSE of deployment "OurService.sar"
  • While using the following kind of "jboss-service.xml" in $SAR type of deployment, EAP 6 throws the Following ERROR stacktrace :
    • jboss-service.xml:
 <?xml version="1.0" encoding="UTF-8"?>
<server xmlns="urn:jboss:service:7.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">

    <mbean code="custom.mbean.MyTestMBean" name="service.server.monitor:service=MyMBean">
         <attribute name="Frequency">5000</attribute>
     <attribute name="SubscriptionList">      
        <subscription-list>
        </subscription-list>
         </attribute>
    </mbean>
</server>

ERROR stacktrace:

 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."ExampleService.sar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."ExampleService.sar".PARSE: JBAS018733: Failed to process phase PARSE of deployment "ExampleService.sar"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017224: Failed to parse service xml ["/path-to/$JBOSS_HOME/standalone/deployments/ExampleService.sar/META-INF/jboss-service.xml"]
    at org.jboss.as.service.ServiceDeploymentParsingProcessor.deploy(ServiceDeploymentParsingProcessor.java:102)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    ... 5 more
Caused by: java.lang.IllegalStateException: Not a textual event (START_ELEMENT)
    at com.ctc.wstx.sr.BasicStreamReader.throwNotTextual(BasicStreamReader.java:5510)
    at com.ctc.wstx.sr.BasicStreamReader.getText(BasicStreamReader.java:855)
    at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.getText(XMLExtendedStreamReaderImpl.java:275)
    at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.unexpectedContent(JBossServiceXmlDescriptorParser.java:629)
    at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.parseAttribute(JBossServiceXmlDescriptorParser.java:380)
    at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.parseMBean(JBossServiceXmlDescriptorParser.java:264)
    at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.readElement(JBossServiceXmlDescriptorParser.java:190)
    at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.readElement(JBossServiceXmlDescriptorParser.java:47)
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
    at org.jboss.as.service.ServiceDeploymentParsingProcessor.deploy(ServiceDeploymentParsingProcessor.java:95)
    ... 6 more

14:38:55,022 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015860: Redeploy of deployment "ExampleService.sar" was rolled back with the following failure message: 
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"ExampleService.sar\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"ExampleService.sar\".PARSE: JBAS018733: Failed to process phase PARSE of deployment \"ExampleService.sar\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017224: Failed to parse service xml [\"/path-to/$JBOSS_HOME/standalone/deployments/ExampleService.sar/META-INF/jboss-service.xml\"]
    Caused by: java.lang.IllegalStateException: Not a textual event (START_ELEMENT)"}}

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content