我在 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
提交
取消