Bug 1159570

Summary: [GSS](6.4.0) CDI injected topic does not work
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Tyronne Wickramarathne <tywickra>
Component: CDI/WeldAssignee: Martin Kouba <mkouba>
Status: CLOSED CURRENTRELEASE QA Contact: Matous Jobanek <mjobanek>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbaranow, bmaxwell, jharting, kkhan, maschmid, mkouba
Target Milestone: DR12   
Target Release: EAP 6.4.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
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: 2019-08-19 12:38:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1165798    
Bug Blocks:    
Attachments:
Description Flags
reproducer none

Description Tyronne Wickramarathne 2014-11-01 15:59:09 UTC
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 15:59:56 UTC
Created attachment 952788 [details]
reproducer

Comment 2 Ron Šmeral 2014-11-03 15:33:43 UTC
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 21:38:04 UTC
Jozef Hartinger <jharting> updated the status of jira WELD-1782 to Reopened

Comment 5 JBoss JIRA Server 2014-11-21 11:56:28 UTC
Jozef Hartinger <jharting> updated the status of jira WELD-1782 to Resolved

Comment 6 Matous Jobanek 2014-12-03 08:39:01 UTC
Verified in EAP 6.4.0.DR12