1. IOException parsing XML document from file ...\mybatisConfig.xml];
nested exception is java.net.ConnectException: Connection timed out: connect
启动服时出现以上异常,从描述上看mybatisConfig.xml中某个链接无法访问,导到连接超时,只需要替换该链接就可以解决
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//ibatis.apache.org//DTD Config 3.0//EN" "http://ibatis.apache.org/dtd/ibatis-3-config.dtd">
<configuration>
</configuration>
将http://ibatis.apache.org/dtd/ibatis-3-config.dtd 替换为 http://mybatis.org/dtd/mybatis-3-config.dtd 即可解决问题
其它配置出现相同异常时,可以参数这个解决方法
2. log4j:ERROR Attempted to append to closed appender named [stdout]
问题的原因是log4j.properties文件配置出错,在rootLogger和mapperLogger中都配置了stdout,删除其中一处即可
3.java.lang.ClassNotFoundException: net.sf.json.JSONObject
造成这个异常的原因有多种,目前遇到的不易处理的就是tomcat,jetty等容器没有引入这个包导致启动项目后访问报异常
处理办法就是在容器中引入这个包