我在 Linux 環境中部署應用程序,我必須成功安裝 tomcat 和 Oracle 數據庫,之后我生成我的表并得到一個在 Windows 環境中運行良好的 .war 文件(模塊)我將它部署在 /tomcat/webapps 下,并正確配置了我的服務器 xml <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> <Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" global="jdbc/vimsDs" initialSize="10" maxActive="100" maxWait="10000" minIdle="10" username="****" name="jdbc/vimsDs" password="*****" removeAbandoned="true" removeAbandonedTimeout="36000" type="javax.sql.DataSource" url="jdbc:oracle:thin:@localhost:1521:XE"/>之后我從tomcat管理器應用程序啟動應用程序,它對我說無法啟動應用程序FAILED - 無法啟動上下文/休息室路徑的應用程序它向我顯示我的應用程序記錄了這個錯誤日志2019-02-25 15:04:47.120 [http-bio-8080-exec-32] ERROR o.s.web.context.ContextLoader - Context initialization failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationConfig': Initialization of bean failed; nested exception is .....
2 回答

人到中年有點甜
TA貢獻1895條經驗 獲得超7個贊
您需要將 JNDI 名稱添加到context.xml您的 WAR 文件中。
文件:/META-INF/context.xml
內容:
<?xml version="1.0" encoding="utf-8" ?>
<Context>
<ResourceLink name="jdbc/vimsDs"
global="jdbc/vimsDs"
type="javax.sql.DataSource" />
</Context>
添加回答
舉報
0/150
提交
取消