Bug 901304 (JBPAPP6-1766) - Inject POJO to MBean by using <inject bean="XXX"> in jboss-service.xml does not work in SAR
Summary: Inject POJO to MBean by using <inject bean="XXX"> in jboss-service.xml does n...
Keywords:
Status: CLOSED EOL
Alias: JBPAPP6-1766
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: unspecified
Version: 6.0.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: TBD EAP 6
Assignee: Kabir Khan
QA Contact:
URL: http://jira.jboss.org/jira/browse/JBP...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-08 03:12 UTC by Masafumi Miura
Modified: 2019-08-19 12:47 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-19 12:47:26 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
HelloService-EAP6-inject-reproducer.tar.gz (3.33 KB, application/x-gzip)
2013-01-08 03:12 UTC, Masafumi Miura
no flags Details
HelloService-EAP5-inject.tar.gz (2.57 KB, application/x-gzip)
2013-01-08 03:13 UTC, Masafumi Miura
no flags Details
HelloService-EAP6-inject-workaround.tar.gz (3.28 KB, application/x-gzip)
2013-01-08 03:19 UTC, Masafumi Miura
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBPAPP6-1766 0 Major Closed Inject POJO to MBean by using <inject bean="XXX"> in jboss-service.xml does not work in SAR 2015-06-17 07:55:49 UTC
Red Hat Issue Tracker WFLY-776 0 Major Open Inject POJO to MBean by using <inject bean="XXX"> in jboss-service.xml does not work in SAR 2015-06-17 07:55:49 UTC

Description Masafumi Miura 2013-01-08 03:12:15 UTC
Affects: Release Notes
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?sbstr=00769055
Steps to Reproduce: 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 

Workaround Description: 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.
project_key: JBPAPP6

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:

{code: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>
{code}

* META-INF/jboss-beans.xml:

{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<deployment ... >
  <bean name="myTask" class="com.redhat.jboss.support.SimpleTask">
  </bean>
</deployment>
{code}

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

{noformat}
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]"]}}}
{noformat}

Comment 1 Masafumi Miura 2013-01-08 03:12:43 UTC
Attachment: Added: HelloService-EAP6-inject-reproducer.tar.gz


Comment 2 Masafumi Miura 2013-01-08 03:13:33 UTC
Attachment: Added: HelloService-EAP5-inject.tar.gz


Comment 3 Masafumi Miura 2013-01-08 03:19:35 UTC
Workaround Description: Added: 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.


Comment 4 Masafumi Miura 2013-01-08 03:19:52 UTC
Attachment: Added: HelloService-EAP6-inject-workaround.tar.gz


Comment 5 Masafumi Miura 2013-01-08 03:32:49 UTC
Link: Added: This issue incorporates AS7-6289



Note You need to log in before you can comment on or make changes to this bug.