在tomcat中發(fā)布web項(xiàng)目,可能是因?yàn)閟pring中配置了jndi(只配置了jndi,其他的有工具包封裝了)。
啟動的時(shí)候報(bào)錯(在項(xiàng)目目錄下,在tomcat中配置context指向項(xiàng)目目錄就沒問題,打包發(fā)布到
tomcat就報(bào)錯了),拋的異常是:
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
在web.xml中添加配置如下:
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
啟動的時(shí)候報(bào)錯(在項(xiàng)目目錄下,在tomcat中配置context指向項(xiàng)目目錄就沒問題,打包發(fā)布到
tomcat就報(bào)錯了),拋的異常是:
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
在web.xml中添加配置如下:
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>