日期:2014-05-17  浏览次数:20694 次

紧急!下午答辩!我用java语言,SSH框架做的一个小系统,联网的情况下可以运行,不联网就运行不了是为什么
各位大侠,我用java语言,运用SSH做的一个小的oa系统,在myeclipse开发环境中做的,数据库是mysql,tomcat6.0.30服务器,B/S模式,联网的时候运行正常,但是不联网就不行。

部署的时候报错:
org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net

Nested exception: 
java.net.UnknownHostException: hibernate.sourceforge.net

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net
Caused by: org.hibernate.MappingException: org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net

Caused by: org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net

------解决方案--------------------
联网问题; dom4j读取xml的时候会进行dtd验证,不联网就验证不了,报网络错误,即你现在的错误!
SAXReader reader=new SAXReader();
reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);//主要是这一句 不进行dtd验证就ok
Document doc=reader.read(in);

reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
在read方法前加入那句就ok;
------解决方案--------------------
整在帮你处理呢!不是你说的问题,把dtd文件下载到本地就行了
------解决方案--------------------
把dtd文件下载到本地就行了