-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: java.net.ConnectException: Connection timed out: connect
PostPosted: Thu Mar 09, 2006 5:40 am 
Newbie

Joined: Wed Dec 14, 2005 7:27 am
Posts: 18
Hibernate version: 2

I'm trying to create pojo files through the *.hbm.xml files using hbm2java, and i get the following error:

Code:
[hbm2java] log4j:WARN No appenders could be found for logger (net.sf.hibernate.util.DTDEntityResolver).
[hbm2java] log4j:WARN Please initialize the log4j system properly.
[hbm2java] java.net.ConnectException: Connection timed out: connect
[hbm2java] at java.net.PlainSocketImpl.socketConnect(Native Method)
[hbm2java] at java.net.PlainSocketImpl.doConnect(Unknown Source)
[hbm2java] at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
[hbm2java] at java.net.PlainSocketImpl.connect(Unknown Source)
[hbm2java] at java.net.Socket.connect(Unknown Source)
[hbm2java] at java.net.Socket.connect(Unknown Source)
[hbm2java] at sun.net.NetworkClient.doConnect(Unknown Source)
[hbm2java] at sun.net.www.http.HttpClient.openServer(Unknown Source)
[hbm2java] at sun.net.www.http.HttpClient.openServer(Unknown Source)
[hbm2java] at sun.net.www.http.HttpClient.<init>(Unknown Source)
[hbm2java] at sun.net.www.http.HttpClient.New(Unknown Source)
[hbm2java] at sun.net.www.http.HttpClient.New(Unknown Source)
[hbm2java] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
[hbm2java] at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
[hbm2java] at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
[hbm2java] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
[hbm2java] at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
[hbm2java] at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown Source)
[hbm2java] at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(Unknown Source)
[hbm2java] at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
[hbm2java] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
[hbm2java] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[hbm2java] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
[hbm2java] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
[hbm2java] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
[hbm2java] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
[hbm2java] at org.jdom.input.SAXBuilder.build(SAXBuilder.java:453)
[hbm2java] at org.jdom.input.SAXBuilder.build(SAXBuilder.java:810)
[hbm2java] at org.jdom.input.SAXBuilder.build(SAXBuilder.java:789)
[hbm2java] at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:98)
[hbm2java] at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java] at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hbm2java] at org.apache.tools.ant.Task.perform(Task.java:364)
[hbm2java] at org.apache.tools.ant.Target.execute(Target.java:341)
[hbm2java] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hbm2java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hbm2java] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hbm2java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hbm2java] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hbm2java] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hbm2java] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hbm2java] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)




Here is my one of my hbm files:

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
   
<hibernate-mapping>
<!--
    Created by the Middlegen Hibernate plugin 2.1

    http://boss.bekk.no/boss/middlegen/
    http://www.hibernate.org/
-->

<class
    name="com.link.bem.hibernate.CoreAction"
    table="Core_Actions"
>
    <meta attribute="class-description" inherit="false">
       @hibernate.class
        table="Core_Actions"
    </meta>

    <id
        name="actionId"
        type="java.lang.Long"
        column="ActionID"
    >
        <meta attribute="field-description">
           @hibernate.id
            generator-class="assigned"
            type="java.lang.Long"
            column="ActionID"


        </meta>
        <generator class="assigned" />
    </id>

    <property
        name="description"
        type="java.lang.String"
        column="Description"
        length="2000"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="Description"
            length="2000"
        </meta>   
    </property>
    <property
        name="startDateTime"
        type="java.sql.Timestamp"
        column="StartDateTime"
        length="23"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="StartDateTime"
            length="23"
        </meta>   
    </property>
    <property
        name="endDateTime"
        type="java.sql.Timestamp"
        column="EndDateTime"
        length="23"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="EndDateTime"
            length="23"
        </meta>   
    </property>
    <property
        name="userCreationId"
        type="java.lang.String"
        column="UserCreationID"
        length="100"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="UserCreationID"
            length="100"
        </meta>   
    </property>
    <property
        name="userUpdateId"
        type="java.lang.String"
        column="UserUpdateID"
        length="100"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="UserUpdateID"
            length="100"
        </meta>   
    </property>
    <property
        name="dateCreation"
        type="java.sql.Timestamp"
        column="DateCreation"
        length="23"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="DateCreation"
            length="23"
        </meta>   
    </property>
    <property
        name="dateUpdate"
        type="java.sql.Timestamp"
        column="DateUpdate"
        length="23"
    >
        <meta attribute="field-description">
           @hibernate.property
            column="DateUpdate"
            length="23"
        </meta>   
    </property>

    <!-- Associations -->

    <!-- bi-directional many-to-one association to CoreEvent -->
    <many-to-one
        name="coreEvent"
        class="com.link.bem.hibernate.CoreEvent"
        not-null="true"
    >
        <meta attribute="field-description">
           @hibernate.many-to-one
            not-null="true"
           @hibernate.column name="EventID"         
        </meta>
        <column name="EventID" />
    </many-to-one>
    <!-- bi-directional many-to-one association to CoreEntity -->
    <many-to-one
        name="coreEntity"
        class="com.link.bem.hibernate.CoreEntity"
        not-null="true"
    >
        <meta attribute="field-description">
           @hibernate.many-to-one
            not-null="true"
           @hibernate.column name="EntityID"         
        </meta>
        <column name="EntityID" />
    </many-to-one>
    <!-- bi-directional many-to-one association to CoreActionType -->
    <many-to-one
        name="coreActionType"
        class="com.link.bem.hibernate.CoreActionType"
        not-null="true"
    >
        <meta attribute="field-description">
           @hibernate.many-to-one
            not-null="true"
           @hibernate.column name="ActionTypeID"         
        </meta>
        <column name="ActionTypeID" />
    </many-to-one>

</class>
</hibernate-mapping>




In the hbm file, i've this header:


Code:
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">



and i'm using hibernate2.jar, hibernate-annotations.jar, hibernate-entitymanager.jar and hibernate-tools.jar files.

I've tried to use hibernate3.jar instead of the hibernate2.jar but i get the following error:

NoClassDefFoundError: net/sf/hibernate/MappingException

I access the dtd file through my browser. I think that the problem is when the hbm2java validates the DTD.
I use the eclipse, and i'm behind a proxy. I've configured the eclipse to work with the proxy, and works. The proof is that, i've accessed a internet page through eclipse.

What can i do to create my pojos?

Thanks,
Pedro


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 09, 2006 5:46 am 
Newbie

Joined: Wed Dec 14, 2005 7:27 am
Posts: 18
Here is a snippet of my ant file:

Code:
   <target name="hbm2java" depends="middlegen" description="Generate .java from .hbm files.">
         
      <taskdef name="hbm2java"
         classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"
         classpathref="classpath.hibernate"/>
      
      <hbm2java output="${path.source}">
         <fileset dir="${path.source}">
            <include name="**/*.hbm.xml"/>
         </fileset>
      </hbm2java>
   </target>



Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 09, 2006 3:02 pm 
Newbie

Joined: Wed Dec 14, 2005 7:27 am
Posts: 18
To solve this problem, the better way is to configure the log4j.properties for doing the Debug during the hbm2java.

Don't ask me where is the log4j.properties because it wasn't me that solved this problem.

Then, with the result of the debug, try to solve your problem.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 10, 2006 6:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you say you are using hibernate2 but your DTD is pointing to hibernate 3 DTDs.

dont mix hibernate 3 and hibernate 2 up - they should be used independently.

For Hibernate 3 use the Hibernate 3 Tools not Hibernate 2 tools.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.