Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1159570 - [GSS](6.4.0) CDI injected topic does not work
[GSS](6.4.0) CDI injected topic does not work
Status: VERIFIED
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CDI/Weld (Show other bugs)
6.3.0
x86_64 Linux
unspecified Severity high
: DR12
: EAP 6.4.0
Assigned To: Martin Kouba
Matous Jobanek
:
Depends On: 1165798
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-01 11:59 EDT by Tyronne Wickramarathne
Modified: 2018-03-06 15:40 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In previous versions of JBoss EAP 6, the injection of a JMS Topic into a CDI bean failed with the following error: [source,] ---- javax.jms.InvalidDestinationException: Not a HornetQ Destination:HornetQTopic[EventTopic] @javax.inject.Inject private javax.jms.Topic topic; ---- In this release, the injection succeeds without error.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
reproducer (3.44 KB, application/x-bzip)
2014-11-01 11:59 EDT, Tyronne Wickramarathne
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker HORNETQ-1096 Major Open HornetQSession CDI / Weld Compatibility 2015-08-05 20:27:51 EDT
JBoss Issue Tracker WELD-1782 Major Resolved Don't wrap resource producer field if the actual type is assignable to Serializable 2015-08-05 20:27:51 EDT

  None (edit)
Description Tyronne Wickramarathne 2014-11-01 11:59:09 EDT
Description of problem:

CDI injection of topic and queue does not work as expected

Version-Release number of selected component (if applicable):

JBoss-EAP-6.3.0-GA

1. Define a ConnectionFactory, Topic resources
2. Inject the defined resources to an JEE component
3. The ConnectionFactory gets injected as expected but the Topic
(A self explanatory reproducer will be attached shortly.)

Actual results:
javax.jms.InvalidDestinationException: "Not a HornetQDestination:HornetQTopic" exception will be thrown 

Expected results:
The JEE component should be able to access the injected destination successfully

Additional info:
Comment 1 Tyronne Wickramarathne 2014-11-01 11:59:56 EDT
Created attachment 952788 [details]
reproducer
Comment 2 Ron Šmeral 2014-11-03 10:33:43 EST
There is a workaround for this, described here - using producer method instead of producer field: https://developer.jboss.org/thread/213568?tstart=0


@Resource(mappedName = "topic/EventTopic")
private Topic topic;

@Produces
public Topic makeTopic() {
    return topic;
}


I'm not sure why the @Resource producer field doesn't work, and the producer method does.
Comment 4 JBoss JIRA Server 2014-11-20 16:38:04 EST
Jozef Hartinger <jharting@redhat.com> updated the status of jira WELD-1782 to Reopened
Comment 5 JBoss JIRA Server 2014-11-21 06:56:28 EST
Jozef Hartinger <jharting@redhat.com> updated the status of jira WELD-1782 to Resolved
Comment 6 Matous Jobanek 2014-12-03 03:39:01 EST
Verified in EAP 6.4.0.DR12

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