struct中<data-sources>问题
在MyEclipse下struct中 通过<data-sources>元素连接MySQL出现如下错误,请哪位高手解决一下
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql://127.0.0.1:3306/ibm'
信息: Marking servlet action as unavailable
2009-9-1 12:32:24 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet /TestStruct threw load() exception
javax.servlet.
UnavailableException: Initializing application data source org.apache.struts.action.DATA_SOURCE
struct-config.xml如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="autoCommit" value="true"/>
<set-property value="com.mysql.jdbc.Driver" property="driverClass"/>
<set-property value="jdbc:mysql://127.0.0.1:3306/ibm" property="url"/>
<set-property value="root" property="user"/>
<set-property value="123" property="password"/>
</data-source>
</data-sources>
<form-beans>
<form-bean name="loginForm" type="com.ibmssz.Form.loginForm"></form-bean>
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings>
<action path="/test" name="loginForm" scope="request" type="com.ibmssz.action.loginAction" input="/index.jsp"></action>
</action-mappings>
<message-resources parameter="com.ibmssz.struts.ApplicationResources" />
</struts-config>
------解决方案--------------------
这是tomcat5.0用的东西,现在不建议这么使用了。
可以配置server.xml,通过jndi的方式获取链接。