结构图
springMVc
src
com.spring.entity
User.java
User.xml
com.spring.dao
com.spring.service
com.spring.control
resource
jdbc.properties
sqlMapConfig.xml
Webroot
web-info
appliaction.xml
springMVC-servlet.xml
web.xml
错误:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in com/spring/entity/User.xml.
--- The error occurred while executing query.
--- Check the select * from t_user .
--- Check the SQL Statement (preparation failed).
--- Cause: java.sql.SQLException: Connections could not be acquired from the underlying database!; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/spring/entity/User.xml.
--- The error occurred while executing query.
--- Check the select * from t_user .
--- Check the SQL Statement (preparation failed).
--- Cause: java.sql.SQLException: Connections could not be acquired from the underlying database!
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in com/spring/entity/User.xml.
--- The error occurred while executing query.
--- Check the select * from t_user .
--- Check the SQL Statement (preparation failed).
--- Cause: java.sql.SQLException: Connections could not be acquired from the underlying database!; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/spring/entity/User.xml.
--- The error occurred while executing query.
--- Check the select * from t_user .
--- Check the SQL Statement (preparation failed).
java.sql.SQLException: Connections could not be acquired from the underlying database!
com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/application.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>springMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<filter>
<filter-name>CharacterFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterFilter</filter-name>
<url-pattern>/*</url-pattern>