3 Replies Latest reply: Jul 19, 2013 10:39 AM by Adam Johnston RSS

MBean complex type attributes

qtm Newbie

Hi,

 

In my jboss-service.xml(I'm using Jboss 7.1.1) I've got a mbean defined and I want to parameterize it:

 

<mbean code="mypackage.MyBean" name="myname">

             <attribute name="simpleAttribute">simplevalue</attribute>

             <attribute name="complexAttribute">

               <firstElement>

                     <secondElement>value1</secondElement>

                     <secondElement>value2</secondElement>

               </firstElement>

             </attribute>

</mbean>

 

My question is how can I read the complexAttribute. I've tried to set it as a string/org.w3c.dom.Element in MyBean. None worked. I'm getting:

 

Caused by: java.lang.IllegalStateException: Not a textual event (START_ELEMENT)

    at com.ctc.wstx.sr.BasicStreamReader.throwNotTextual(BasicStreamReader.java:5444)

 

 

Thanks

  • 1. Re: MBean complex type attributes
    madchedar0 Newbie

    qtm,

     

    Did you figure out what the issue was?  I'm currently running into similar errors in my jboss-service.xml...

     

    Thanks

  • 2. Re: MBean complex type attributes
    qtm Newbie

    Unfortunately no. I switched to using a subsystem , not a sar.

  • 3. Re: MBean complex type attributes
    Adam Johnston Newbie

    I ran into the same issue when trying to use remoting 2.2.  It looks like jboss-service.xml validates against jboss-service_7_0.xsd by default in my version of jboss which does not allow complex attributes.

     

    <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">

     

    You could probably give it a schema that it will validate against, but I decided to make all the remoting calls within java instead of using jboss-service.xml.

     

     

     

    {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"bacon-helloworld.jar\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"bacon-helloworld.jar\".PARSE: JBAS018733: Failed to process phase PARSE of deployment \"bacon-helloworld.jar\"
        Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017224: Failed to parse service xml [\"/content/bacon-helloworld.jar/META-INF/jboss-service.xml\"]
        Caused by: java.lang.IllegalStateException: Not a textual event (START_ELEMENT)"}}