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