我在我的窗口框上有apache tomcat 5.5.28,我試圖部署一個可以在其他服務器上正常工作的web應用程序(WAR)。tomcat oracle datasource
但是我在創建數據源時遇到了問題。我不確定格式。 db是oracle。
這是我在server.xml中的。
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
<Resource
name="tomdb11"
type="oracle.jdbc.pool.OracleDataSource"
maxActive="4"
maxIdle="2"
username="tomdb11"
maxWait="5000"
driverClassName="oracle.jdbc.driver.OracleDriver"
validationQuery="select * from dual"
password="remotedb11"
url="jdbc:oracle:thin:@dbserver:1521:orcl"/>
<Resource
auth="Container"
description="User database that can be updated and saved"
name="UserDatabase"
type="org.apache.catalina.UserDatabase"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml"/>
</GlobalNamingResources>
如何訪問這個在web.xml通常在那裏我有什麼這在其他服務器的工作原理是
<context-param>
<param-name>databaseUser</param-name>
<param-value>tomdb11</param-value>
</context-param>
<context-param>
<param-name>databasePassword</param-name>
<param-value>tomdb11</param-value>
</context-param>
<context-param>
<param-name>databaseSchema</param-name>
<param-value>TOMDBADMINN11</param-value>
</context-param>
而且我這麼想嗎?
編輯:我得到以下異常:
javax.naming.NameNotFoundException: Name tomdb11 is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.taw.database.DatabaseService.<init>(DatabaseService.java:19)
at com.taw.database.DatabaseServices.init(DatabaseServices.java:40)
你提到的這些其他服務器是什麼?這些還是Tomcat還是你在使用另一個容器? – 2009-12-16 18:54:22
appserver日誌說什麼?請編輯您的問題併發布錯誤/例外。 – BalusC 2009-12-16 18:58:51
javax.naming.NameNotFoundException:名稱jdbc未綁定在此上下文中\t at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:153 ) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137) at javax.naming.InitialContext.lookup(Unknown Source) at com.taw.database.DatabaseService。(DatabaseService.java:19) 在com.taw.database.DatabaseServices.init(DatabaseServices.java:40) 在com.taw.web.BaseProxyDispatcher.initializeDatabaseServices(BaseProxyDispatcher.java:225) 中C –
user229432
2009-12-16 19:40:36