Uploaded image for project: 'JBoss Enterprise Application Platform 6'
  1. JBoss Enterprise Application Platform 6
  2. JBPAPP6-1766

Inject POJO to MBean by using <inject bean="XXX"> in jboss-service.xml does not work in SAR

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Migrated to another ITS
    • Affects Version/s: EAP 6.0.1
    • Fix Version/s: TBD EAP 6
    • Component/s: None
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      1. Extract the attached HelloService-EAP6-inject-reproducer.tar.gz
      2. modify "jboss.home" and "jboss.server.config" in build.properties to suit your environment
      3. execute "ant jar" to create HelloService.sar archive
      4. execute "ant deploy" to deploy the sar archive to JBoss

      Show
      1. Extract the attached HelloService-EAP6-inject-reproducer.tar.gz 2. modify "jboss.home" and "jboss.server.config" in build.properties to suit your environment 3. execute "ant jar" to create HelloService.sar archive 4. execute "ant deploy" to deploy the sar archive to JBoss
    • Affects:
      Release Notes
    • Workaround Description:
      Hide

      Define the POJO as a MBean then inject it via MBean Object name like <inject bean="example:type=HelloService,service=myTask"/> instead of <inject bean="myTask"/>. See the attached HelloService-EAP6-inject-workaround.tar.gz.

      Show
      Define the POJO as a MBean then inject it via MBean Object name like <inject bean="example:type=HelloService,service=myTask"/> instead of <inject bean="myTask"/> . See the attached HelloService-EAP6-inject-workaround.tar.gz.
    • Docs QE Status:
      NEW

      Description

      The following injecting POJO to MBean by using <inject bean="myTask"/> in jboss-service.xml of SAR works fine in EAP 5:

      • META-INF/jboss-service.xml:
      <server>
        <mbean code="com.redhat.jboss.support.HelloService"
               name="example:type=HelloService,service=Hello">
           <attribute name="Message">Hello!!</attribute>
           <attribute name="Task"><inject bean="myTask"/></attribute>
        </mbean>
      </server>
      
      • META-INF/jboss-beans.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <deployment ... >
        <bean name="myTask" class="com.redhat.jboss.support.SimpleTask">
        </bean>
      </deployment>
      

      But the same way does not work in EAP 6 with the following ERROR at deployment of SAR:

      ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.mbean.registration.example:type=HelloService,service=Hello Missing[JBAS014861: <one or more transitive dependencies>]","jboss.mbean.service.example:type=HelloService,service=Hello.start Missing[jboss.mbean.service.myTask.start]","jboss.mbean.service.example:type=HelloService,service=Hello.create Missing[jboss.mbean.service.myTask.create]"]}}}
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  mmiura Masafumi Miura
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: