spring xml 在验证XML时,可能会联网下载dtd, schema; 如果网络有问题,就会出错。
解决办法是:把远程的schema/dtd地址换成本地classpath路径。 比如
<!– Before –>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<!– After –>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"
classpath:org/apache/ibatis/builder/xml/mybatis-3-config.dtd">
参考:
https://groups.google.com/forum/?fromgroups=#!topic/mybatis-user/ssNHzaDWn-w