1

我正在尝试设置从队列到主题的内部桥接,但出现“查找失败”异常。

以下是更多细节:

环境:GlassFish 3.1.2.2(全新安装)和嵌入式 JMS 主机

  1. 创建队列连接池(javax.jms.QueueConnectionFactory):pool1(jndi和池名)
  2. 创建主题连接池(javax.jms.TopicConnectionFactory):pool2(jndi和池名)
  3. 创建队列:queue1(jndi 和队列名称)
  4. 创建主题:queue1(jndi 和队列名称)

domain.xml 配置如下:

 <jms-service default-jms-host="default_JMS_host">
    <jms-host host="localhost" name="default_JMS_host" lazy-init="false">
        <property name="imq.bridge.enabled" value="true"></property>
    <property name="imq.bridge.admin.user" value="admin"></property>
        <property name="imq.bridge.admin.password" value="admin"></property>
        <property name="imq.bridge.bridge1.type" value="jms"></property>
        <property name="imq.bridge.activelist" value="bridge1"></property>
        <property name="imq.bridge.bridge1.xmlurl" value="file:///c:/tmp/bridge.xml"></property>
    </jms-host>
  </jms-service>

和 bridge.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jmsbridge SYSTEM "sun_jmsbridge_1_0.dtd">
<jmsbridge name="bridge1">
  <link name="link1">
    <source connection-factory-ref="pool1" destination-ref="queue1">
    </source>
    <target connection-factory-ref="pool2" destination-ref="topic1">
    </target>
  </link>
  <connection-factory ref-name="pool1" lookup-name="pool1"/>
  <connection-factory ref-name="pool2" lookup-name="pool2" />
  <destination ref-name="queue1" name="queue1" type="queue" lookup-name="queue1" />
  <destination ref-name="topic1" name="topic1" type="topic" lookup-name="topic1" />
</jmsbridge>

例外:

[01/Feb/2013:16:14:56 CAT] WARNING [B2217]: Failed to start bridge service manager:
javax.naming.NamingException: Lookup failed for 'pool1' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.
JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: pool1 not found]
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
        at javax.naming.InitialContext.lookup(InitialContext.java:411)
        at javax.naming.InitialContext.lookup(InitialContext.java:411)
        at com.sun.messaging.bridge.service.jms.JMSBridge.createConnectionFactory(JMSBridge.java:513)
        at com.sun.messaging.bridge.service.jms.JMSBridge.createLink(JMSBridge.java:333)
        at com.sun.messaging.bridge.service.jms.JMSBridge.init(JMSBridge.java:227)
        at com.sun.messaging.bridge.service.jms.BridgeImpl.start(BridgeImpl.java:125)
        at com.sun.messaging.bridge.BridgeServiceManagerImpl.startBridge(BridgeServiceManagerImpl.java:447)
        at com.sun.messaging.bridge.BridgeServiceManagerImpl.start(BridgeServiceManagerImpl.java:255)
        at com.sun.messaging.jmq.jmsserver.Broker._start(Broker.java:1548)
        at com.sun.messaging.jmq.jmsserver.Broker.start(Broker.java:456)
        at com.sun.messaging.jmq.jmsserver.BrokerProcess.start(BrokerProcess.java:164)
        at com.sun.messaging.jmq.jmsserver.DirectBrokerProcess.start(DirectBrokerProcess.java:92)
        at com.sun.messaging.jmq.jmsclient.runtime.impl.BrokerInstanceImpl.start(BrokerInstanceImpl.java:206)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
        at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: javax.naming.NameNotFoundException: pool1 not found
        at com.sun.enterprise.naming.impl.TransientContext.doLookup(TransientContext.java:248)

文档非常好,但我无法解决这个问题......

4

0 回答 0