diff options
Diffstat (limited to 'java/client/src/main')
| -rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/AMQSession.java | 10 | ||||
| -rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java index 6d4d6cbaad..b08a97bc84 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java @@ -56,9 +56,9 @@ import javax.jms.TopicSubscriber; import org.apache.log4j.Logger; import org.apache.qpid.AMQException; -import org.apache.qpid.AMQInvalidSelectorException; import org.apache.qpid.AMQUndeliveredException; import org.apache.qpid.AMQInvalidRoutingKeyException; +import org.apache.qpid.AMQInvalidArgumentException; import org.apache.qpid.client.failover.FailoverSupport; import org.apache.qpid.client.message.AbstractJMSMessage; import org.apache.qpid.client.message.JMSBytesMessage; @@ -521,7 +521,7 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi 0, // methodId AMQConstant.REPLY_SUCCESS.getCode(), // replyCode new AMQShortString("JMS client closing channel")); // replyText - + getProtocolHandler().syncWrite(frame, ChannelCloseOkBody.class, timeout); // When control resumes at this point, a reply will have been received that // indicates the broker has closed the channel successfully @@ -1049,7 +1049,7 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi { registerConsumer(consumer, false); } - catch (AMQInvalidSelectorException ise) + catch (AMQInvalidArgumentException ise) { JMSException ex = new InvalidSelectorException(ise.getMessage()); ex.setLinkedException(ise); @@ -1057,7 +1057,9 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi } catch (AMQInvalidRoutingKeyException e) { - throw new InvalidDestinationException(amqd.getRoutingKey().toString()); + JMSException ide = new InvalidDestinationException("Invalid routing key:"+amqd.getRoutingKey().toString()); + ide.setLinkedException(e); + throw ide; } catch (AMQException e) { diff --git a/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java b/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java index 6ef187286b..7cadbd409a 100644 --- a/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java +++ b/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java @@ -23,7 +23,6 @@ package org.apache.qpid.client.handler; import org.apache.log4j.Logger; import org.apache.qpid.AMQChannelClosedException; import org.apache.qpid.AMQException; -import org.apache.qpid.AMQInvalidSelectorException; import org.apache.qpid.AMQInvalidRoutingKeyException; import org.apache.qpid.client.AMQNoConsumersException; import org.apache.qpid.client.AMQNoRouteException; @@ -74,11 +73,11 @@ public class ChannelCloseMethodHandler implements StateAwareMethodListener { throw new AMQNoRouteException("Error: " + reason, null); } - else if (errorCode == AMQConstant.INVALID_SELECTOR) + else if (errorCode == AMQConstant.INVALID_ARGUMENT) { - _logger.debug("Broker responded with Invalid Selector."); + _logger.debug("Broker responded with Invalid Argument."); - throw new AMQInvalidSelectorException(String.valueOf(reason)); + throw new org.apache.qpid.AMQInvalidArgumentException(String.valueOf(reason)); } else if (errorCode == AMQConstant.INVALID_ROUTING_KEY) { |
