Name [jdbc/travel] is not bound in this Context. Unable to find [jdbc].

描述:

travel 這裏是數據庫名稱

沒有在Context裏面綁定jdbc/travel。

解決方案:

在Context里加入

<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver"
              name="jdbc/travel"
              type="javax.sql.DataSource"
              url="jdbc:mysql://localhost:3306/travel?characterEncoding=utf-8"
              username="root"
              password="pwd"
              maxActive="200"
              maxIdle="50"
              maxWait="3000"
              />

然後在項目工程的web.xml裏面加入依賴:

<resource-ref>
<description>jdbc/travel</description>
<res-ref-name>jdbc/travel</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

錯誤修正了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章