我正在尝试配置连接到IBM MQ的JMS入站端点。但是在部署时,我们会收到“ java.lang.ClassCastException”。
下面是完成的配置的详细信息。
先决条件
1.将wmq-client-8.0.0.4.jar文件复制到/ dropins目录。
2.将jta_1.1_1.0.0.jar文件复制到/ lib目录。
3.从/conf/etc/launch.ini文件中删除以下行:javax.jms,\
4. .bindings放置在C:\ jndidirectory
5.启动WSO2 EI服务器。
创建如下的JMS入站端点
<?xml version="1.0" encoding="UTF-8"?>
<inboundEndpoint name="ibm-inbound" onError="common_error_handler" protocol="jms" sequence="online-seq" suspend="false" xmlns="http://ws.apache.org/ns/synapse">
<parameters>
<parameter name="interval">10</parameter>
<parameter name="sequential">false</parameter>
<parameter name="coordination">false</parameter>
<parameter name="transport.jms.Destination">MYQUEUE</parameter>
<parameter name="transport.jms.CacheLevel">3</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName">HAQU1</parameter>
<parameter name="java.naming.factory.initial">com.sun.jndi.fscontext.RefFSContextFactory</parameter>
<parameter name="java.naming.provider.url">file:///C:/jndidirectory</parameter>
<parameter name="transport.jms.UserName">user</parameter>
<parameter name="transport.jms.SessionAcknowledgement">AUTO_ACKNOWLEDGE</parameter>
<parameter name="transport.jms.Password">password</parameter>
<parameter name="transport.jms.SessionTransacted">false</parameter>
<parameter name="transport.jms.ConnectionFactoryType">queue</parameter>
<parameter name="transport.jms.ContentType">application/json</parameter>
<parameter name="transport.jms.SharedSubscription">false</parameter>
<parameter name="transport.jms.ResetConnectionOnPollingSuspension">true</parameter>
</parameters>
</inboundEndpoint>
在部署CAR时,出现以下错误。
org.apache.synapse.SynapseException:初始化入站端点rm-to-ec-online-inbound时出错
在org.apache.synapse.inbound.InboundEndpoint.init(InboundEndpoint.java:83)
在org.apache.synapse.deployers.InboundEndpointDeployer.deploySynapseArtifact(InboundEndpointDeployer.java:57)
在org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.deploy(AbstractSynapseArtifactDeployer.java:197)
在org.wso2.carbon.application.deployer.synapse.SynapseAppDeployer.deployArtifactType(SynapseAppDeployer.java:1065)
在org.wso2.carbon.application.deployer.synapse.SynapseAppDeployer.deployArtifacts(SynapseAppDeployer.java:106)
在org.wso2.carbon.application.deployer.internal.ApplicationManager.deployCarbonApp(ApplicationManager.java:272)
在org.wso2.carbon.application.deployer.CappAxis2Deployer.deploy(CappAxis2Deployer.java:72)
在org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
在org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807)
在org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
在org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
在org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
在org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:371)
在org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:59)
在org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:67)
在org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.runAxisDeployment(CarbonDeploymentSchedulerTask.java:93)
在org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.run(CarbonDeploymentSchedulerTask.java:138)
在java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)
在java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
在java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.access $ 301(ScheduledThreadPoolExecutor.java:180)
在java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)
在java.lang.Thread.run(Thread.java:748)
原因:java.lang.ClassCastException:com.ibm.mq.jms.MQConnectionFactory无法转换为javax.jms.QueueConnectionFactory
在org.wso2.carbon.inbound.endpoint.protocol.jms.factory.JMSConnectionFactory.createConnectionFactory(JMSConnectionFactory.java:187)中的
在org.wso2.carbon.inbound.endpoint.protocol.jms.factory.JMSConnectionFactory。(JMSConnectionFactory.java:164)
在org.wso2.carbon.inbound.endpoint.protocol.jms.factory.CachedJMSConnectionFactory。(CachedJMSConnectionFactory.java:38)
在org.wso2.carbon.inbound.endpoint.protocol.jms.JMSPollingConsumer。(JMSPollingConsumer.java:78)
位于org.wso2.carbon.inbound.endpoint.protocol.jms.JMSProcessor.init(JMSProcessor.java:89)
在org.apache.synapse.inbound.InboundEndpoint.init(InboundEndpoint.java:79)
...还有23个
答案 0 :(得分:1)
帮忙的是,将%CARBON_HOME%\ cont \ etc \ launch.ini中的javax.jms,\
行注释掉了-在此处https://docs.wso2.com/display/EI660/Configure+with+IBM+WebSphere+MQ处#9