Open glassfishrobot opened 11 years ago
@glassfishrobot Commented Reported by cplaetzinger
@glassfishrobot Commented @nigeldeakin said: It appears that the consumer event feature is only available when using the Java SE client (i.e. when using com.sun.messaging.jms.Connection). JMSRA's implementations of Connection do not have a setConsumerEventListener method. So this is not a bug but a missing feature.
@glassfishrobot Commented @nigeldeakin said: As for why you got that ClassCastException: I suspect it was because the com.sun.messaging.Destination class being used by your MDB was loaded using a different class loader from the one used by the resource adapter (which created the com.sun.messaging.jms.ra.TemporaryQueue). So Java didn't recognise one as a supertype of the other.
How did you get your MDB to compile the reference to com.sun.messaging.Destination? Did you include imq.jar in your application?
Nigel
@glassfishrobot Commented cplaetzinger said: Hi Nigel,
in reply to your first comment: Should I create a new issue requesting this feature or will you do so?
Regarding the your second comment: yes. We have some Glassfish jars including imqjmsra.jar in the classpath for compiling our application. But we do not package it/deploy it. Is there a workaround to get rid of the ClassCastException?
Many thanks Christian
@glassfishrobot Commented @nigeldeakin said: Please create a new feature request (e.g. "Add support for consumer event listeners in JMSRA".
Even if you are able to work around the TemporaryQueue class cast problem you will not be able to cast your connection to a com.sun.messaging.jms.Connection (which is the only class that implements setConsumerEventListener), since the resource adapter uses a completely different implementation class.
Nigel
@glassfishrobot Commented cplaetzinger said: Created #239 requesting support for consumer event listeners in JMSRA.
@glassfishrobot Commented This issue was imported from java.net JIRA MQ-238
According to http://docs.oracle.com/cd/E26576_01/doc.312/e24945/client-design-and-features.htm#gkvyk I want to set a EventListener to get notified on consumer events. The code runs inside Glassfish. Stripped down I basically do the following:
This ends up with the following exception:
As far as I can see from available javadocs com.sun.messaging.Destination is a superclass of com.sun.messaging.jms.ra.TemporaryQueue.
Environment
Glassfish: 3.1.2.2
Affected Versions
[4.5.2]