【发布时间】:2013-09-26 17:30:49
【问题描述】:
您好,我的应用程序日志中出现以下异常堆栈跟踪。
20/09/2013 22.26.49 - Caught exception in Exception Strategy: Connection and domain type do not match
java.lang.IllegalArgumentException: Connection and domain type do not match
at org.mule.transport.jms.Jms102bSupport.createSession(Jms102bSupport.java:108)
at org.mule.transport.jms.JmsConnector.getSession(JmsConnector.java:579)
at org.mule.transport.jms.JmsConnector.getSession(JmsConnector.java:558)
at org.mule.transport.jms.JmsMessageDispatcher.dispatchMessage(JmsMessageDispatcher.java:141)
at org.mule.transport.jms.JmsMessageDispatcher.doDispatch(JmsMessageDispatcher.java:73)
at org.mule.transport.AbstractMessageDispatcher$Worker.run(AbstractMessageDispatcher.java:262)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy.rejectedExecution(ThreadPoolExecutor.java:1895)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:765)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1288)
at org.mule.work.ScheduleWorkExecutor.doExecute(ScheduleWorkExecutor.java:41)
我不太明白它的真正含义,
谁能解释一下连接和域类型不匹配是什么意思
并且可能是它可能发生的示例场景。
使用配置的 mule 出站发送数据
<multicasting-router>
<jms:outbound-endpoint topic="SAMPLEMESSAGES" transformer-refs="DomToXml ObjectToJms" connector-ref="jmsConnector" />
</multicasting-router>
可以找到连接器配置here由于某种原因无法在此处粘贴xml
就像archer提到的我确实看过activeMQ源代码,只是把它粘贴在这里
@Override
public Session createSession(Connection connection, boolean topic, boolean transacted,
int ackMode, boolean noLocal) throws JMSException
{
if (connection == null)
{
throw new IllegalArgumentException("Connection is null");
}
if (topic && connection instanceof TopicConnection)
{
return ((TopicConnection) connection).createTopicSession(noLocal, ackMode);
}
else if (connection instanceof QueueConnection)
{
// for transacted sessions the ackMode is always ignored, but
// set it for readability (SESSION_TRANSACTION is recommented
// for this case).
return ((QueueConnection) connection).createQueueSession(
transacted, (transacted ? Session.SESSION_TRANSACTED : ackMode));
}
else
{
throw new IllegalArgumentException("Connection and domain type do not match, connection is of type " + connection.getClass().getName());
}
}
我想了解在什么情况下传入的客户端连接不是 topicConnection 或 queueConnection ,我可以编写什么客户端代码来导致异常发生
谢谢
【问题讨论】:
-
你能分享你的连接器配置吗?
-
连接器配置是指您的 jms 连接器(称为 jmsConnector)的配置
-
我已将连接器配置添加为要点gist.github.com/sudarshan89/6651572,我有些无法将其添加到问题中