-->
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: Mapping Problem?
PostPosted: Thu Oct 27, 2005 4:32 am 
Newbie

Joined: Thu Oct 13, 2005 10:25 am
Posts: 19
Location: Germany, Hamburg
Hallo, ich bekomme beim laufen lassen meiner Tests folgenden Fehler und finde die Ursache nicht. Kann mir jemand helfen?
Gruß,
Jan

Hibernate version: 2

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class name="de.bitmanager.epower.vo.SalesActivity" table="salesActivity">
<id name="salesActivityId" type="int" unsaved-value="0" >
<column name="salesActivityId" sql-type="int" not-null="true"/>
<generator class="sequence">
<param name="sequence">salesActivityId</param>
</generator>
</id>
<many-to-one name="salesActivityType"/>
<property name="platinId"/>
<property name="name"/>
<property name="saleBegin"/>
<property name="saleEnd"/>
<property name="saleWeek"/>
<property name="saleTimeframe"/>
<property name="marketingIdea"/>
<property name="salesArea"/>
</class>

</hibernate-mapping>
<!-- parsed in 0ms -->


Full stack trace of any exception that occurs:
SCHWERWIEGEND: Could not compile the mapping document
net.sf.hibernate.MappingException: duplicate import: SalesActivity
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.addInputStream(Configuration.java:281)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:304)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:957)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:909)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:845)
at de.bitmanager.jnet.or.ORBase.getConfiguration(ORBase.java:66)
at de.bitmanager.jnet.or.ORBase.getSessionFactory(ORBase.java:119)
at de.bitmanager.jnet.or.ORBase.openSession(ORBase.java:260)
at de.bitmanager.jnet.or.ORBase.save(ORBase.java:393)
at de.bitmanager.epower.service.impl.ServiceBase.save(ServiceBase.java:69)
at de.bitmanager.epower.service.impl.TodoService.save(TodoService.java:80)
at de.bitmanager.epower.junit.TodoInsertTest.test(TodoInsertTest.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
FEHLER: Error reading resource: de/bitmanager/epower/vo/SalesActivity.hbm.xml


Name and version of the database you are using: postgresql


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 27, 2005 4:42 am 
Newbie

Joined: Thu Oct 13, 2005 10:25 am
Posts: 19
Location: Germany, Hamburg
Hat sich erledigt...fehlte ein Feld in der Bean...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 3:02 am 
Newbie

Joined: Thu Oct 13, 2005 11:08 am
Posts: 5
dann hast du 2 Fehler mit einem mal gelöst.
denn die fehler meldung weist darauf hin das es 2 einträgt in der Hibernate.cfg.xml gibt die SalesActivity heißen


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 3:19 am 
Newbie

Joined: Thu Oct 13, 2005 10:25 am
Posts: 19
Location: Germany, Hamburg
Nein, die Fehlermeldung ist vollkommen missverständlich. Ich habe diese auch so gedeutet, aber dann auch gelesen, dass sie nicht korrekt ist. So war es dann auch. Die Einträge in der Hibernate Mapping waren korrekt, aber in der Bean selber fehlte ein Feld, welches im Mapping angegeben war.
Gruß,
Jan


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.