最近发现我的一个web项目只要在家启动时候就出现一个连接错误的问题,大概如下:
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘orderVersionMapper‘ defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean ‘netezzaSqlSessionFactory‘ while setting bean property ‘sqlSessionFactory‘; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘netezzaSqlSessionFactory‘ defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: java.net.ConnectException: Connection timed out: connect
经过IDE的代码异常提示,在配置文件applicationContext.xml的头文件中有一个头提示无法访问,于是copy 地址http://ibatis.apache.org/dtd/ibatis-3-config.dtd再浏览器中访问,果然请求超时,通过查询发现更改地址就行了,在此记录下:
在配置文件中,将http://ibatis.apache.org/dtd/ibatis-3-config.dtd更改为http://mybatis.org/dtd/mybatis-3-config.dtd
参考地址:http://mybatis-user.963551.n3.nabble.com/Connection-time-out-error-td4026924.html