2016-05-09 11 views
0

我們有一個基於spring的應用程序無法在Weblogic 10.3容器上進行部署。部署完成後,應用程序將嘗試在Weblogic容器的JMS模塊中查找兩個本地JMS隊列,並且在部署發生時,應用程序會查找一個本地隊列,但不會發現另一個本地隊列。Weblogic部署無法解析本地隊列

兩個隊列配置完全相同,除了名稱不同。爲什麼應用程序找到一個隊列好,但沒有其他?

我已經檢查過隊列名稱JNDI名稱多次,我看不到任何拼寫錯誤或類似的東西。

我已經打開了跟蹤日誌記錄,我可以看到用於查找兩個隊列的連接工廠是相同的,兩個隊列的彈簧JMS配置完全相同,但一個發現另一個隊列沒有。

我不知道還有什麼要檢查以確定問題可能是什麼......任何想法?

這是我得到的失敗時查找在WebLogic JNDI樹中的隊列中的一個錯誤:

Caused by: javax.naming.NameNotFoundException: Unable to resolve 'QUEUE_NAME'. Resolved ''; remaining name 'QUEUE_NAME' at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)

PS:兩個隊列具有相同的子部署和目標相同的配置。

----編輯追加神器的Spring XML配置片斷如下----

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:tx="http://www.springframework.org/schema/tx" xmlns:security="http://www.springframework.org/schema/security" 
    xmlns:lang="http://www.springframework.org/schema/lang" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
       http://www.springframework.org/schema/tx 
       http://www.springframework.org/schema/tx/spring-tx-3.0.xsd 
       http://www.springframework.org/schema/context 
       http://www.springframework.org/schema/context/spring-context-3.0.xsd 
       http://www.springframework.org/schema/security 
       http://www.springframework.org/schema/security/spring-security-3.0.xsd 
       http://www.springframework.org/schema/lang 
       http://www.springframework.org/schema/lang/spring-lang-3.0.xsd"> 

    <context:component-scan base-package="com.company.service" /> 

    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate"> 
     <property name="environment"> 
      <props> 
       <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop> 
      </props> 
     </property> 
    </bean> 

    <!-- this is the Message Driven POJO (MDP) --> 
    <bean id="messageListener" class="com.company.service.controller.ServiceJMSListener" /> 
    <!-- this is the message listener container --> 
    <bean id="jmsContainer" 
     class="org.springframework.jms.listener.DefaultMessageListenerContainer"> 
     <property name="connectionFactory" ref="queueConnectionFactory" /> 
     <property name="destination" ref="inboundQueue" /> 
     <property name="messageListener" ref="messageListener" /> 
     <property name="concurrentConsumers" value="1" /> 
    </bean> 
    <!-- JNDI Connection Factory --> 
    <bean id="queueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"> 
     <property name="jndiTemplate"> 
      <ref bean="jndiTemplate" /> 
     </property> 
     <property name="jndiName"> 
      <value>SERVICE_QCF</value> 
     </property> 
    </bean> 
    <!-- Queue to listen to --> 
    <bean id="inboundQueue" class="org.springframework.jndi.JndiObjectFactoryBean"> 
     <property name="jndiTemplate"> 
      <ref bean="jndiTemplate" /> 
     </property> 
     <property name="jndiName"> 
      <value>QUEUE_A</value> 
     </property> 
    </bean> 

    <bean id="outboundQueue" class="org.springframework.jndi.JndiObjectFactoryBean"> 
     <property name="jndiTemplate"> 
      <ref bean="jndiTemplate" /> 
     </property> 
     <property name="jndiName"> 
      <value>QUEUE_B</value> 
     </property> 
    </bean> 

    <bean id="queueTemplate" class="org.springframework.jms.core.JmsTemplate"> 
     <property name="connectionFactory"> 
      <ref bean="queueConnectionFactory" /> 
     </property> 
     <property name="destinationResolver"> 
      <ref bean="jmsDestinationResolver" /> 
     </property> 
    </bean> 

    <bean id="jmsDestinationResolver" 
     class="org.springframework.jms.support.destination.JndiDestinationResolver"> 
     <property name="jndiTemplate"> 
      <ref bean="jndiTemplate" /> 
     </property> 
     <property name="cache"> 
      <value>true</value> 
     </property> 
    </bean> 

</beans> 

回答

1

你可以看看在你正在運行的服務器的JDNI樹來檢查是否建立或不排隊,並將其綁定到哪個jndi名稱?爲此使用管理控制檯。

+0

隊列位於Weblogic服務器(Jms)上的jms模塊中,該模塊獨立於工件未能部署的Weblogic Server(App)。 Weblogic Admin Server管理JMS和App Weblogic服務器。現在,使用管理控制檯,我可以轉到JMS Weblogic Server並查看其JNDI樹。在JNDI樹中,我可以看到工件試圖連接到的兩個隊列(一個成功,另一個完全不成功)。 JNDI樹中的兩個隊列都顯示隊列的綁定名稱就像隊列名稱本身一樣。儘管如此,部署只能看到其中一個隊列。 –

+0

您可以發佈您的應用程序中運行的代碼,嘗試連接到jms服務器。 –

+0

Emmanuel,請參閱主帖中添加的Spring XML配置。 –