导入一个SSM项目结果报错

本文主要探讨了在使用Spring框架过程中遇到的一些典型错误及其解决方案,包括constructor-arg属性配置问题、DynamicWebModule版本冲突、HTTP状态码404及500错误的排查方法。
摘要由CSDN通过智能技术生成

1.cvc-complex-type.3.2.2: 元素 'constructor-arg' 中不允许出现属性 'name'

这个找了百度,有的说是因为spring版本的问题,因为默认3.0中constructor-arg不支持name属性,因此把版本由默认改成4.0  

Update Project后发现还是报错

后来发现name属性可以用Index进行替代。在SqlSessionTemplate中只有一个字段,name="sqlServerMapper"等价于index="0"


改完之后果然不报错了

2.Dynamic Web Module 3.0 requires Java 1.6 or newer

这个是由于工程中jdk 本工程有的使用了1.5,所以报错

https://blog.csdn.net/liuxinghao/article/details/37088063 根据这个改了一遍工程的所有属性,然而Update Project还是报错。

接下来修改了.setting中的部分文件的版本号,将所有1.5全部改成1.7,参考网址:https://blog.csdn.net/bobjy_happybird/article/details/46621355

Update Project后成功

3.HTTP Status 404

上述环境错误全部修改完成之后,运行时又报了错 404 找不到该文件


查看源码发现 提交时的表单 <form action="/power/getTestHouseInfo" method="post">

对应的getTestHouseInfo是一个映射 

	@PostMapping("/getTestHouseInfo")
	@ResponseBody
	public  DefaultResp<HouseInfo> getTestHouseInfo(@RequestParam("housename") String houseName){
		DefaultResp<HouseInfo> errorResp = new DefaultResp<HouseInfo>(
				Const.PARAM_ERROR, Const.PARAM_ERROR_MSG, null);
		
		HouseInfo houseInfo = sqlServerService.getTestHouseInfo(houseName);
		if (houseInfo == null)
			return errorResp;
		DefaultResp<HouseInfo> resp = new DefaultResp<HouseInfo>();
		resp.setCode(Const.SUCCESS);
		resp.setMsg(Const.SUCCESS_MSG);
		resp.setData(houseInfo);
		return resp;
	}

power是当前工程名。并不需要,然后把地址修改为 getTestHouseInfo

当前问题解决

4.HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 

type Exception report

message Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is 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 create PoolableConnectionFactory (Network error IOException: Connection timed out: connect)
### The error may exist in edu/ahpu/mapper/TestHouseInfoMapper.java (best guess)
### The error may involve edu.ahpu.mapper.TestHouseInfoMapper.getTestHouseInfo
### 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 create PoolableConnectionFactory (Network error IOException: Connection timed out: connect)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

root cause

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 create PoolableConnectionFactory (Network error IOException: Connection timed out: connect)
### The error may exist in edu/ahpu/mapper/TestHouseInfoMapper.java (best guess)
### The error may involve edu.ahpu.mapper.TestHouseInfoMapper.getTestHouseInfo
### 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 create PoolableConnectionFactory (Network error IOException: Connection timed out: connect)
	org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:79)
	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447)
	com.sun.proxy.$Proxy15.selectOne(Unknown Source)
	org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:167)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
	com.sun.proxy.$Proxy19.getTestHouseInfo(Unknown Source)
	edu.ahpu.service.SqlServerService.getTestHouseInfo(SqlServerService.java:30)
	edu.ahpu.controller.JsonServiceController.getTestHouseInfo(JsonServiceController.java:46)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:220)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:134)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

root cause

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 create PoolableConnectionFactory (Network error IOException: Connection timed out: connect)
### The error may exist in edu/ahpu/mapper/TestHouseInfoMapper.java (best guess)
### The error may involve edu.ahpu.mapper.TestHouseInfoMapper.getTestHouseInfo
### 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 create PoolableConnectionFactory (Network error IOException: Connection timed out: connect)
	org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434)
	com.sun.proxy.$Proxy15.selectOne(Unknown Source)
	org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:167)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
	com.sun.proxy.$Proxy19.getTestHouseInfo(Unknown Source)
	edu.ahpu.service.SqlServerService.getTestHouseInfo(SqlServerService.java:30)
	edu.ahpu.controller.JsonServiceController.getTestHouseInfo(JsonServiceController.java:46)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:220)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:134)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

root cause

org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Network error IOException: Connection timed out: connect)
	org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
	org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:84)
	org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:70)
	org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336)
	org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84)
	org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
	org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
	org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
	org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
	org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434)
	com.sun.proxy.$Proxy15.selectOne(Unknown Source)
	org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:167)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
	com.sun.proxy.$Proxy19.getTestHouseInfo(Unknown Source)
	edu.ahpu.service.SqlServerService.getTestHouseInfo(SqlServerService.java:30)
	edu.ahpu.controller.JsonServiceController.getTestHouseInfo(JsonServiceController.java:46)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:220)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:134)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

root cause

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Network error IOException: Connection timed out: connect)
	org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
	org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
	org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
	org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
	org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
	org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:84)
	org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:70)
	org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336)
	org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84)
	org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
	org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
	org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
	org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
	org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434)
	com.sun.proxy.$Proxy15.selectOne(Unknown Source)
	org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:167)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
	com.sun.proxy.$Proxy19.getTestHouseInfo(Unknown Source)
	edu.ahpu.service.SqlServerService.getTestHouseInfo(SqlServerService.java:30)
	edu.ahpu.controller.JsonServiceController.getTestHouseInfo(JsonServiceController.java:46)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:220)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:134)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

root cause

java.sql.SQLException: Network error IOException: Connection timed out: connect
	net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:421)
	net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
	net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:185)
	org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
	org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
	org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
	org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
	org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
	org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
	org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
	org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
	org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:84)
	org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:70)
	org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336)
	org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84)
	org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
	org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
	org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
	org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
	org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434)
	com.sun.proxy.$Proxy15.selectOne(Unknown Source)
	org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:167)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
	com.sun.proxy.$Proxy19.getTestHouseInfo(Unknown Source)
	edu.ahpu.service.SqlServerService.getTestHouseInfo(SqlServerService.java:30)
	edu.ahpu.controller.JsonServiceController.getTestHouseInfo(JsonServiceController.java:46)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:220)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:134)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

root cause

java.net.ConnectException: Connection timed out: connect
	java.net.DualStackPlainSocketImpl.connect0(Native Method)
	java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
	java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
	java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	java.net.Socket.connect(Socket.java:589)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:297)
	net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:247)
	net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:322)
	net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
	net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:185)
	org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
	org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
	org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
	org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
	org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
	org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
	org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
	org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
	org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:84)
	org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:70)
	org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336)
	org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84)
	org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
	org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
	org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
	org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
	org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434)
	com.sun.proxy.$Proxy15.selectOne(Unknown Source)
	org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:167)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
	com.sun.proxy.$Proxy19.getTestHouseInfo(Unknown Source)
	edu.ahpu.service.SqlServerService.getTestHouseInfo(SqlServerService.java:30)
	edu.ahpu.controller.JsonServiceController.getTestHouseInfo(JsonServiceController.java:46)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:497)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:220)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:134)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
报了一堆的错,目前还没有解决


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值