如何从JBOSS Fuse向Weblogic JMS发送JMS消息

时间:2015-12-01 11:09:47

标签: java jboss jms weblogic-10.x

我正在尝试从Active-MQ向Weblogic发送消息。 我创建了JMS桥,如下所示:

<jmsBridgeConnectors>     
 <jmsQueueConnector name="JreportRequestBridge-Inbound" jndiOutboundTemplate="#remoteJndi"outboundQueueConnectionFactoryName="jms/ConnectionFactory"
    localQueueConnectionFactory="#activemqConnectionFactory">        
            <inboundQueueBridges>          
                <inboundQueueBridge inboundQueueName="RequestQueue"/></inboundQueueBridges>      
            </jmsQueueConnector>    
        </jmsBridgeConnectors>
<bean id="remoteJndi" class="org.springframework.jndi.JndiTemplate">        
        <property name="environment">                
            <props>                        
                <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
                <prop key="java.naming.provider.url">t3://host:port</prop>                
            </props>
        </property>
    </bean>

现在,当我尝试使用目标网址创建Brokerservice时,我遇到异常,如下所示:

java.io.IOException: Transport scheme NOT recognized: [t3]
    at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:25)
    at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:171)
    at org.apache.activemq.transport.TransportFactory.bind(TransportFactory.java:108)
    at org.apache.activemq.broker.BrokerService.createTransportConnector(BrokerService.java:1348)
    at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:163)
    at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:153)
    at test.oas.Server.<init>(Server.java:32)
    at test.oas.Server.main(Server.java:99)
Caused by: java.io.IOException: Could not find factory class for resource: META-INF/services/org/apache/activemq/transport/t3
    at org.apache.activemq.util.FactoryFinder.doFindFactoryProperies(FactoryFinder.java:90)
    at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:58)
    at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:47)
    at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:167)
    ... 6 more

创建BrokerService的代码:

try {            
            //This message broker is embedded            
            BrokerService broker = new BrokerService();            
            broker.setPersistent(false);            
            broker.setUseJmx(false);            
            broker.addConnector(messageBrokerUrl);            
            broker.start();       
            } catch (Exception e) {

                e.printStackTrace();      
                }     

有人可以帮帮我吗。

1 个答案:

答案 0 :(得分:0)

这是一个老问题,但正如Alan在评论中提到的,这是因为ActiveMQ需要“jms”驱动程序才能与Weblogic交谈。

在weblogic 11g(10.3.6)中,您需要获取库wlthint3client.jar并将其放在ActiveMQ内的lib文件夹中。这是 weblogic t3瘦客户端,它允许使用 t3 协议连接到它。