0
我們在房子中使用maven來構建Spring 3.0.X
應用程序,所以,我已將所有Tibco相關的jar文件添加到/server/<Profile>/lib
文件夾中,在maven pom .xml文件我已經添加了以下變化Spring應用程序無法找到「com.tibco.tibjms.naming.TibjmsInitialContextFactory」
<dependency>
<groupId>com.tibco</groupId>
<artifactId>tibjms</artifactId>
<scope>provided</scope>
<version>4.4.1v2</version>
</dependency>
部署war文件到文件夾jboss 5.1/server/<Profile>/deploy
。
在部署中出現以下錯誤,我重新啓動服務器多次,仍然彈簧應用程序無法從配置文件的/ lib文件夾加載類。
春天JMS的config.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:jms="http://www.springframework.org/schema/jms"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.0.xsd">
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">
initialFactory
</prop>
<prop key="java.naming.provider.url">
url
</prop>
</props>
</property>
</bean>
<bean id="queueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate" ref="jndiTemplate" />
<property name="jndiName"
value="queueConn" />
</bean>
<bean id="listener"
class="class">
</bean>
<jms:listener-container connection-factory="queueConnectionFactory"
acknowledge="transacted" concurrency="5">
<jms:listener destination="Outbound.Queue"
ref="listener" />
</jms:listener-container>
</beans>
更新:我啓用了JBoss的類加載,類被加載到內存中,當我檢查了boot.log文件tibjms。不明白爲什麼spring不能從/ lib加載類。
爲什麼'scope'' provided''? jar是否已經存在於jboss lib中? – sidgate
我很困惑,爲什麼你用你的方式擺弄罐子。如果你提供作爲範圍,它告訴maven當它建立你的戰爭,不用麻煩得到他們從回購作爲jboss/tomcat什麼已經有他們。所以在我看來,目前你的問題是任何正在爲你的應用程序提供服務的問題。你能在你的應用服務器內的任何地方找到這些罐子嗎? – nuzz
@nuzz是的,我將罐子添加到'/ server//lib'文件夾。我正在做'提供'範圍,因爲jar已經在服務器lib文件夾中可用。我期待jboss類加載器爲我加載類。 –
Zeus