org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: c

原创 2012年03月28日 20:07:11

框架:struts2  2.2.3 + hibernate 3.0

所报异常:


exception

java.lang.reflect.InvocationTargetException
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 java.lang.reflect.Method.invoke(Method.java:597)
 com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)
 com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)
 com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
 org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)

  ........此处省略若干行.....

root cause

java.lang.NoClassDefFoundError: Could not initialize class cn.csu.xgb.util.HibernateUtils
 cn.csu.xgb.dao.common.DaoSupport.find(DaoSupport.java:148)
 cn.csu.xgb.dao.HibernateImpl.JczdDaoImpl.find(JczdDaoImpl.java:30)
 cn.csu.xgb.action.xsglAction.ShowJjpyAction.execute(ShowJjpyAction.java:20)
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 java.lang.reflect.Method.invoke(Method.java:597)
 com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)
 com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)
 com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
 org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
 com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)

 ......此处省略若干行.....

 

root cause                                 此处为根本错误!!!

org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
    at org.dom4j.io.SAXReader.read(SAXReader.java:484)
    at org.dom4j.io.SAXReader.read(SAXReader.java:321)
    at packageMap3.DomParse.main(DomParse.java:25)
Nested exception:
java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.<init>(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)

 

原因:1.*.hbm.xml  或者 hibernate.cfg.xml 文件头部的 dtd导入url出现错误。

             可能的错误形式:

           <!DOCTYPE hibernate-mapping PUBLIC
                  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
                 "
http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

解决方案:

             找到 hibernate3.jar ,分别打开jar包内的hibernate-mapping-3.0.dtd  和 hibernate-configuration-3.0.dtd 文件,比较自己

           所填写的<!DOCTYPE ....> 是不是跟这两个文件里的<!DOCTYPE ....> 分别对应正确。用文件里面的<!DOCTYPE ....>即可解决

            问题!(报此异常的 一种解决办法,我测试正确!)

           正确形式:

           *.hbm.xml中 的为:<!DOCTYPE hibernate-mapping PUBLIC
                                              "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
                                              "
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

            hiberante.cfg.xml的为:<!DOCTYPE hibernate-configuration PUBLIC
                                                      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                                                      "
http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

           

     

 

相关文章推荐

hibernate 的 org.dom4j.DocumentException: Connection timed out 问题

hibbernate的异常的一种情况 org.dom4j.DocumentException: Connection timed out Connection timed out...

hibernate3.0 org.dom4j.DocumentException: Connection timed out: connect Nested exception:

所报异常: exception java.lang.reflect.InvocationTargetException  sun.reflect.NativeMethodAccessorIm...
  • ye1992
  • ye1992
  • 2013年07月01日 17:10
  • 3752

java.net.ConnectException: Connection timed out: connect

今天启动tomcat之后,发现报错: com.mysql.jdbc.CommunicationsException: Communications link failure due to u...

Dom4J读取XML文件时出现的connection timed out:connect Nested exception异常解决方法

最近在项目中实现一个双数据库的动态读取树形菜单功能,通过了Dom4J来实现,运行过程中出现以下问题: 在本论坛查到原因为  dom4j会去拿DTD增加那些DOCTYPE的默认属性,因...

org.dom4j.DocumentException: Connection timed out

用ssh写的一个小项目,经常

jdom/dom4j解析xml提示Connection timed out错误(关闭DTD验证)

一段用jdom解析XML的代码,最近莫名其妙抛异常了。 看一下异常完全是八竿子打不上的,ConnectException, 莫不成解析XML还需要联网?  java.net.Connect...

Dom4j (org.dom4j.DocumentException: c Nested exception: c.)

dom4j 是一种解析 XML 文档的开放源代码 XML 框架,与 W3C DOM API 相比,使用 dom4j 所包含的解析器的好处是 dom4j 拥有本地的 XPath 支持.DOM 解析器不支...

调用远程主机上的RMI服务时抛出java.rmi.ConnectException: Connection refused to host: 127.0.0.1异常原因及解决方案

最近使用jmx遇到一个问题,client/server同在一台机器上,jmx client能够成功连接server 如果把server移植到另一台机器上10.1.60.14,抛出如下异常: ...

mybatis启动不了,nested exception is org.xml.sax.SAXParseExceptionpublicId,文档类型声明包含或指向的标记声明必须格式正确。

今天遇到一个问题很是郁闷。一个项目在这边的虚拟机中运行得好好的,放到另一个地方就运行不起来了,日志打印如下。又是换jar包又是换tomcat都一个样。潘总出山了。这时为什么会出现这么一个ip : 19...

hibernate3.0 org.dom4j.DocumentException: Connection timed out: connect Nested exception:

所报异常: exception java.lang.reflect.InvocationTargetException  sun.reflect.NativeMethodAccess...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: c
举报原因:
原因补充:

(最多只允许输入30个字)