2011-08-10 55 views
0

我有一個場景,我需要爲不同的客戶端部署不同名稱(如TestA,TestB等)的同一場戰爭。每個戰爭文件連接到不同的數據庫。所以我用相應的數據庫連接屬性來複制具有不同名稱的同一個戰爭。在jboss中部署不同名稱的相同戰爭5

爲特斯塔

連接屬性
hibernate.connection.driver_class = com.mysql.jdbc.Driver 
hibernate.connection.url = jdbc:mysql://localhost:3306/TESTADB 
hibernate.connection.username = testa 
hibernate.connection.password = testa 
hibernate.dialect = org.hibernate.dialect.MySQLDialect 

爲TESTB

連接屬性
hibernate.connection.driver_class = com.mysql.jdbc.Driver 
hibernate.connection.url = jdbc:mysql://localhost:3306/TESTBDB 
hibernate.connection.username = testb 
hibernate.connection.password = testb 
hibernate.dialect = org.hibernate.dialect.MySQLDialect 

但只有種皮運行,其他戰爭沒有運行。

我已經在JBOSS的F:/jboss-5.0.0./server/default文件夾中部署了所有的戰爭。

我瀏覽使用

http://localhost:8080/TestA 
http://localhost:8080/TestB 
+0

你有什麼異常嗎? –

回答

0

在每次戰爭的應用程序,嘗試配置的jboss-web.xml中

<jboss-web> 
<context-root>/TestA</context-root> 
</jboss-web> 

<jboss-web> 
<context-root>/TestB</context-root> 
</jboss-web> 

這應該工作...