axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ziborov Egor (JIRA)" <>
Subject [jira] [Created] (AXIS2-5825) [Axis2][Tibco] Corre
Date Mon, 05 Dec 2016 13:09:59 GMT
Ziborov Egor created AXIS2-5825:

             Summary: [Axis2][Tibco] Corre
                 Key: AXIS2-5825
             Project: Axis2
          Issue Type: Bug
          Components: JMS transport
    Affects Versions: 1.7.4
            Reporter: Ziborov Egor
            Priority: Minor

When we tried to work with Tibco ESB we handle ClassCastException:
java.lang.ClassCastException: com.tibco.tibjms.TibjmsxSessionImp cannot be cast to javax.jms.QueueSession
at org.apache.axis2.transport.jms.JMSUtils.createConsumer(

Currently Axis2 logic based on correlation Queue (as destination) <-> QueueSession (as
a session) and the same for the topics. But it's not correct. Offer rewrite method createConsumer(Session,
Destination, String) to:
 public static MessageConsumer createConsumer(Session session, Destination dest, String messageSelector)
throws JMSException {
        return (dest instanceof Queue ?
                createQueueConsumer(session, (Queue)dest, messageSelector) :
                createTopicConsumer(session, (Topic) dest, messageSelector));

    public static MessageConsumer createQueueConsumer(Session session, Queue queue, String
messageSelector) throws JMSException {
        return (session instanceof QueueSession) ?
                ((QueueSession)session).createReceiver(queue, messageSelector) :
                session.createConsumer(queue, messageSelector);

    public static MessageConsumer createTopicConsumer(Session session, Topic topic, String
messageSelector) throws JMSException {
        return (session instanceof TopicSession) ?
                ((TopicSession)session).createSubscriber(topic, messageSelector, false) :
                session.createConsumer(topic, messageSelector);

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message