我有Synapse配置来从Oracle JMS队列中读取消息,调用Web服务并捕获日志中的响应。配置基于ws02 with oracle
我试图扩展配置以捕获另一个Oracle quueue中的响应,但是我收到如下错误。看起来,尽管将回复目的地类型指示为“队列”,他仍然在尝试创建主题会话而不是队列会话。
2014-12-15 14:13:21,728 [-] [HttpClientWorker-1] ERROR JMSSender Unable to create a JMSMessageSender for : org.apache.axis2.transport.jms.JMSOutTransportInfo@42bed00f oracle.jms.AQjmsException: JMS-107: Operation not allowed on Connection
at oracle.jms.AQjmsError.throwEx(AQjmsError.java:334)
at oracle.jms.AQjmsConnection.createTopicSession(AQjmsConnection.java:728)
at org.apache.axis2.transport.jms.JMSOutTransportInfo.createJMSSender(JMSOutTransportInfo.java:365)
at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:121)
at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:119)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
配置:
<definitions xmlns="http://ws.apache.org/ns/synapse">
<proxy name="StockQuoteProxy" transports="https http jms" startOnLoad="true" trace="disable">
<target>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService" />
</endpoint>
<inSequence>
<log level="full" />
<enrich>
<source type="body" clone="true" />
<target type="property" property="jms_body_text" />
</enrich>
<property name="jms_body_text" expression="get-property('jms_body_text')" scope="default" />
<xslt key="jmsMsgToSoapMsg_xslt">
<property name="jms_text" expression="get-property('jms_body_text')" />
</xslt>
<log level="full">
<property name="After transformation" value="************" />
</log>
</inSequence>
<outSequence>
<log level="full">
<property name="OUT SEQUENCE" value="************" />
</log>
<send/>
</outSequence>
</target>
<publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>ContentType</jmsProperty>
<default>text/plain</default>
</rules>
</parameter>
<parameter name="transport.jms.Destination">cn=tro_Q_JMS1,cn=OracleDBQueues,cn=ORCL,cn=OracleContext,ou=Services, o=sgi,c=us</parameter>
<parameter name="transport.jms.ReplyDestinationType">queue</parameter>
<parameter name="transport.jms.ReplyDestination">cn=tro_Q_JMS2,cn=OracleDBQueues,cn=ORCL,cn=OracleContext,ou=Services, o=sgi,c=us</parameter>
</proxy>
<localEntry key="jmsMsgToSoapMsg_xslt" src="file:jmsMsgToSoapMsg.xslt" />
<sequence name="fault">
<log level="full">
<property name="MESSAGE" value="Executing default "fault" sequence" />
<property name="ERROR_CODE" expression="get-property('ERROR_CODE')" />
<property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')" />
</log>
<drop/>
</sequence>
<sequence name="main">
<log/>
<drop/>
</sequence>
</definitions>
答案 0 :(得分:0)
我想我发现了这个问题。看起来Oracle JMS与Axis2 jms传输库不兼容。
JMSOutTransportInfo(JMSConnectionFactory jmsConnectionFactory, Destination dest,
String contentTypeProperty) {
this.jmsConnectionFactory = jmsConnectionFactory;
this.destination = dest;
destinationType = dest instanceof Topic ? JMSConstants.DESTINATION_TYPE_TOPIC
: JMSConstants.DESTINATION_TYPE_QUEUE;
this.contentTypeProperty = contentTypeProperty;
}
为了确定目标是主题还是队列axis2,jms首先检查目标是否实现了Topic接口。问题是,Oracle类对于Topic和Queue都是相同的,AQjmsDestination同时实现了Topic和Queue接口。