-->
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.  [ 3 posts ] 
Author Message
 Post subject: help me !!
PostPosted: Tue May 18, 2004 6:35 am 
Newbie

Joined: Mon May 10, 2004 9:48 pm
Posts: 2
I use hebern8IDE throws Exception when I clicked "Apply" button,I do not know why???

Exception lists :

E:\hibern8ide-0.9>java -classpath E:\hibern8ide-0.9\lib\pf-joi-full.jar;E:\hiber
n8ide-0.9\lib\hibernate2.jar;E:\hibern8ide-0.9\lib\hibern8ide.jar;E:\hibern8ide-
0.9\lib\cglib2.jar;E:\hibern8ide-0.9\lib\commons-collections.jar;E:\hibern8ide-0
.9\lib\commons-lang.jar;E:\hibern8ide-0.9\lib\commons-logging.jar;E:\hibern8ide-
0.9\lib\dom4j.jar;E:\hibern8ide-0.9\lib\log4j.jar;E:\hibern8ide-0.9\lib\odmg.jar
;E:\hibern8ide-0.9\lib\xalan.jar;E:\hibern8ide-0.9\lib\jdbc2_0-stdext.jar;E:\hib
ern8ide-0.9\lib\jta.jar;E:\hibernateTest\src\;E:\hibernateTest\WEB-INF\classes\
net.sf.hibern8ide.Hibern8IDE
18:32:28,452 INFO Environment:432 - Hibernate 2.1.1
18:32:28,472 INFO Environment:466 - loaded properties from resource hibernate.p
roperties: {hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, h
ibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net
.sf.hibernate.cache.HashtableCacheProvider, hibernate.max_fetch_depth=1, hiberna
te.dialect=net.sf.hibernate.dialect.Oracle9Dialect, hibernate.jdbc.use_streams_f
or_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true
1, false 0, yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.conne
ction.username=qdjs, hibernate.connection.url=jdbc:oracle:thin:@135.163.64.223:1
521:crm, hibernate.show_sql=true, hibernate.connection.password=qdjs, hibernate.
connection.pool_size=1}
18:32:28,472 INFO Environment:480 - using java.io streams to persist binary typ
es
18:32:28,472 INFO Environment:481 - using CGLIB reflection optimizer
18:32:28,492 INFO Configuration:877 - configuring from file: hibernate.cfg.xml
18:32:28,722 INFO Configuration:300 - Mapping resource: testcom/util/Cat.hbm.xm
l
18:32:28,942 INFO Binder:225 - Mapping class: testcom.util.Cat -> CAT
18:32:29,243 INFO Configuration:300 - Mapping resource: testcom/util/Customer.h
bm.xml
18:32:29,343 INFO Binder:225 - Mapping class: testcom.util.Customer -> DC_CUSTO
MER
18:32:29,723 INFO Configuration:998 - Configured SessionFactory: null
18:32:29,723 INFO Configuration:166 - Mapping file: E:\hibernateTest\src\testco
m\util\Cat.hbm.xml
18:32:29,763 ERROR Configuration:250 - Could not compile the mapping document
net.sf.hibernate.MappingException: duplicate import: Cat
at net.sf.hibernate.cfg.Mappings.addImport(Mappings.java:82)
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:126)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:217)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1204)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:247)
at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:169)
at net.sf.hibern8ide.Hibern8IDE.reconfig(Hibern8IDE.java:137)
at net.sf.hibern8ide.Hibern8IDE$3.configurationChanged(Hibern8IDE.java:3
83)
at net.sf.hibern8ide.ConfigurationUI$ApplyConfig.actionPerformed(Configu
rationUI.java:245)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
86)


Top
 Profile  
 
 Post subject: reinforce:
PostPosted: Tue May 18, 2004 6:40 am 
Newbie

Joined: Mon May 10, 2004 9:48 pm
Posts: 2
Cat.hbm.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="testcom.util.Cat" table="CAT">
<id name="id" type="string">
<column name="CAT_ID" not-null="true" sql-type="char(32)"/>
<generator class="sequence"/>
</id>
<property name="name">
<column name="NAME" not-null="true" sql-type="varchar(16)"/>
</property>
<property name="sex"/>
<property name="weight"/>
</class>
</hibernate-mapping>

Cat.java
package testcom.util;

/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Date: 2004-5-13 </p>
* <p>Time: 16:53:15 </p>
* <p>Copyright: Copyright (c) 2004</p>
*/
public class Cat {

private String id;
private String name;
private char sex;
private float weight;

public Cat() {
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public char getSex() {
return sex;
}

public void setSex(char sex) {
this.sex = sex;
}

public float getWeight() {
return weight;
}

public void setWeight(float weight) {
this.weight = weight;
}

}


Top
 Profile  
 
 Post subject: problem parsing configuration
PostPosted: Mon May 24, 2004 6:17 am 
Newbie

Joined: Mon May 24, 2004 6:07 am
Posts: 6
Hi

I try to use hibernate, but I always get following error (some error with the DTD sheme) when I try to configure hibernate:

Configuration cfg = new Configuration().configure ("/resources/hibernate.cfg.xml");

->
0 [main] INFO net.sf.hibernate.cfg.Environment - Hibernate 2.1.1
0 [main] INFO net.sf.hibernate.cfg.Environment - hibernate.properties not found
0 [main] INFO net.sf.hibernate.cfg.Environment - using CGLIB reflection optimizer
15 [main] INFO net.sf.hibernate.cfg.Configuration - configuring from resource: /resources/hibernate.cfg.xml
15 [main] INFO net.sf.hibernate.cfg.Configuration - Configuration resource: /resources/hibernate.cfg.xml
78 [main] DEBUG net.sf.hibernate.util.DTDEntityResolver - trying to locate http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath under net/sf/hibernate/
net.sf.hibernate.HibernateException: problem parsing configuration/resources/hibernate.cfg.xml
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:906)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:845)
at ch.ejpd.jdbkof.client.testClient.<init>(testClient.java:56)
at ch.ejpd.jdbkof.client.testClient.main(testClient.java:85)
Caused by: org.dom4j.DocumentException: Error on line 3 of document : java.lang.NullPointerException Nested exception: java.lang.NullPointerException
at org.dom4j.io.SAXReader.read(SAXReader.java:355)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:901)
... 3 more
78 [main] ERROR net.sf.hibernate.cfg.Configuration - problem parsing configuration/resources/hibernate.cfg.xml
org.dom4j.DocumentException: Error on line 3 of document : java.lang.NullPointerException Nested exception: java.lang.NullPointerException
at org.dom4j.io.SAXReader.read(SAXReader.java:355)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:901)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:845)
at ch.ejpd.jdbkof.client.testClient.<init>(testClient.java:56)
at ch.ejpd.jdbkof.client.testClient.main(testClient.java:85)
Nested exception:
java.lang.NullPointerException
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:658)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at org.dom4j.io.SAXReader.read(SAXReader.java:339)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:901)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:845)
at ch.ejpd.jdbkof.client.testClient.<init>(testClient.java:56)
at ch.ejpd.jdbkof.client.testClient.main(testClient.java:85)

My config doc:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory>

<!--Mapping files -->
<mapping resource="DTOSystemInfo.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Whats wrong ... (I am using jdk 1.4.2_02 with eclipse, hibernate 2.1.3)

Thanks very much


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.