-1
我正在開發一個在Tomcat下工作的簡單Java應用程序。作爲數據庫,我選擇了MySQL,並通過JDBC連接器與Tomcat服務器進行通信。根據文檔,我從MySQL網站下載了連接器,並將其放在Tomcat的目錄lib /下;我也已經添加在server.xml中有如下描述:未檢測到Tomcat JDBC Connector
<Context docBase="user-accounts" path="/user-accounts" reloadable="true"
source="org.eclipse.jst.jee.server:user-accounts">
<Resource driverClassName="com.mysql.jdbc.Driver"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
initialSize="10"
maxActive="100"
maxIdle="50"
minEvictableIdleTimeMillis="55000"
minIdle="10"
name="jdbc/accountsDB"
password="password"
removeAbandoned="true"
removeAbandonedTimeout="55"
testOnBorrow="true"
timeBetweenEvictionRunsMillis="34000"
type="javax.sql.DataSource"
url="jdbc:mysql://localhost:3306/account_schema"
username="user"
validationInterval="34"
validationQuery="select 1" />
</Context>
,但我得到了以下錯誤:
javax.servlet.ServletException: javax.naming.NameNotFoundException: Name [jdbc/accountsDB] is not bound in this Context. Unable to find [jdbc]
我缺少什麼?
是的,那是一個錯字。 –