idea在applicationContext.xml引入jdbc.properties报错

我不管我就是萌 java工程师  2017-11-09 02:21:04
[DEBUG] 2017-11-09 14:18:34,046 method:org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.resolveException(AbstractHandlerExceptionResolver.java:134)
Resolving exception from handler [public java.lang.String com.inventory.controller.AdminController.login(java.lang.String,java.lang.String,javax.servlet.http.HttpServletRequest)]: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class '${jdbc.driverClassName}'
### The error may exist in file [C:\Users\est-5\Desktop\jxc\target\jxc\WEB-INF\classes\com\inventory\mappers\EmployeeMapper.xml]
### The error may involve com.inventory.dao.EmployeeDAO.login
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class '${jdbc.driverClassName}'
[DEBUG] 2017-11-09 14:18:34,049 method:org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.resolveException(AbstractHandlerExceptionResolver.java:134)
Resolving exception from handler [public java.lang.String com.inventory.controller.AdminController.login(java.lang.String,java.lang.String,javax.servlet.http.HttpServletRequest)]: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class '${jdbc.driverClassName}'
### The error may exist in file [C:\Users\est-5\Desktop\jxc\target\jxc\WEB-INF\classes\com\inventory\mappers\EmployeeMapper.xml]
### The error may involve com.inventory.dao.EmployeeDAO.login
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class '${jdbc.driverClassName}'
[DEBUG] 2017-11-09 14:18:34,049 method:org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.resolveException(AbstractHandlerExceptionResolver.java:134)
Resolving exception from handler [public java.lang.String com.inventory.controller.AdminController.login(java.lang.String,java.lang.String,javax.servlet.http.HttpServletRequest)]: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class '${jdbc.driverClassName}'
### The error may exist in file [C:\Users\est-5\Desktop\jxc\target\jxc\WEB-INF\classes\com\inventory\mappers\EmployeeMapper.xml]
### The error may involve com.inventory.dao.EmployeeDAO.login
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class '${jdbc.driverClassName}'
[DEBUG] 2017-11-09 14:18:34,053 method:org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:984)
Could not complete request
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class '${jdbc.driverClassName}'
### The error may exist in file [C:\Users\est-5\Desktop\jxc\target\jxc\WEB-INF\classes\com\inventory\mappers\EmployeeMapper.xml]
### The error may involve com.inventory.dao.EmployeeDAO.login
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class '${jdbc.driverClassName}'
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371)
at com.sun.proxy.$Proxy14.selectOne(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:163)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:68)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)
at com.sun.proxy.$Proxy15.login(Unknown Source)
at com.inventory.controller.AdminController.login(AdminController.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.j
...全文
449 9 点赞 打赏 收藏 举报
写回复
9 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
我打开两个文件都是一样的编码
  • 打赏
  • 举报
回复
ostools 2017-11-09
引用 7 楼 qq_36534825 的回复:
大神n++是什么意思啊
NotePad++
  • 打赏
  • 举报
回复
大神n++是什么意思啊
  • 打赏
  • 举报
回复
ostools 2017-11-09
你用n++把2个文件编码设置成一样的再试试
  • 打赏
  • 举报
回复
是成功的,那你的意思就是我的编码有问题!
  • 打赏
  • 举报
回复
ostools 2017-11-09
引用 3 楼 qq_36534825 的回复:
都看了都是一样的
你直接改成value=com.mysql.... 如果成功,就说明你原来编码不同 如果不成功,说明配置或jar包有问题
  • 打赏
  • 举报
回复
都看了都是一样的
  • 打赏
  • 举报
回复
ostools 2017-11-09
nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class '${jdbc.driverClassName}' 看看2个文件的编码是否一致
  • 打赏
  • 举报
回复
  • 打赏
  • 举报
回复
相关推荐
发帖
Java EE
加入

6.7w+

社区成员

J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
申请成为版主
帖子事件
创建了帖子
2017-11-09 02:21
社区公告
暂无公告