Bug 1159570 - [GSS](6.4.0) CDI injected topic does not work
Summary: [GSS](6.4.0) CDI injected topic does not work
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CDI/Weld
Version: 6.3.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: DR12
: EAP 6.4.0
Assignee: Martin Kouba
QA Contact: Matous Jobanek
URL:
Whiteboard:
Depends On: 1165798
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-01 15:59 UTC by Tyronne Wickramarathne
Modified: 2019-08-19 12:43 UTC (History)
6 users (show)

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.
Clone Of:
Environment:
Last Closed: 2019-08-19 12:38:24 UTC
Type: Bug
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker HORNETQ-1096 0 Major Open HornetQSession CDI / Weld Compatibility 2015-08-06 00:27:51 UTC
Red Hat Issue Tracker WELD-1782 0 Major Resolved Don't wrap resource producer field if the actual type is assignable to Serializable 2015-08-06 00:27:51 UTC

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


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