-->
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.  [ 6 posts ] 
Author Message
 Post subject: MappingException error
PostPosted: Wed Jun 22, 2005 2:36 pm 
Beginner
Beginner

Joined: Sun Aug 22, 2004 5:32 pm
Posts: 40
I am getting a MappingException error as follows:
net.sf.hibernate.MappingException: duplicate import: CaseVO

I don't see anything wrong with my mapping file. Anyone have any suggestions on what type of things to look for that might cause this error?

Thanks..... :)

_________________
Scott
www.HikeHaven.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 22, 2005 3:03 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
I've gotten that error when using the Ant tasks. It happens if you point to a cfg file that lists CaseVO as a mapping, and then you also list the mapping in the Ant task (<fileset><include name="...). You have to specify one or the other, not both. I think you can also make the same mistake in the eclipse plugins.


Top
 Profile  
 
 Post subject: Re: MappingException error
PostPosted: Wed Jun 22, 2005 3:03 pm 
Beginner
Beginner

Joined: Sun Aug 22, 2004 5:32 pm
Posts: 40
hacktorious wrote:
I am getting a MappingException error as follows:
net.sf.hibernate.MappingException: duplicate import: CaseVO

I don't see anything wrong with my mapping file. Anyone have any suggestions on what type of things to look for that might cause this error?

Thanks..... :)


If I change the class name of CaseVO to CaseVOX in the mapping file class tag everything works fine. When I change it back to CaseVO the error comes back. This tells me there is something somewhere referring to caseVO, but I am not sure where to look.

_________________
Scott
www.HikeHaven.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 22, 2005 3:08 pm 
Beginner
Beginner

Joined: Sun Aug 22, 2004 5:32 pm
Posts: 40
nathanmoon wrote:
I've gotten that error when using the Ant tasks. It happens if you point to a cfg file that lists CaseVO as a mapping, and then you also list the mapping in the Ant task (<fileset><include name="...). You have to specify one or the other, not both. I think you can also make the same mistake in the eclipse plugins.


Hmmm, interesting. I am using an ant task as well, but don't see anything referring to the CaseVO.hbm.xml. I do have an include as follows:
<include name="**/*.hbm.xml"/>

Could this cause the problem, or is it probably something else?

I never had an issue until I started adding more properties to my CaseVO.

_________________
Scott
www.HikeHaven.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 22, 2005 3:23 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
It can cause the problem if the configuration file your task points to also lists CaseVO in a <mapping> tag. It looks like you are using H2, and I only used H2 ant tasks briefly, so I don't remember what they look like, but somewhere you point to XXX.cfg.xml. Make sure that cfg.xml file doesn't have mapping tags. If it does, either remove them, or remove the <include name="**/*.hbml.xml"/> tag. If you have both, Hibernate will try to import the mapping twice and throw that exception.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 22, 2005 3:27 pm 
Beginner
Beginner

Joined: Sun Aug 22, 2004 5:32 pm
Posts: 40
Odd. After reading the following post in a different forum, I deleted the folders in my classes directory and all is well. Somehow this fixed the error.

Other Post:
http://www.theospi.org/modules/newbb/vi ... 68&forum=7

I am not exactly why this fixed the issue so if anyone has a clue please let me know.

Thanks.

_________________
Scott
www.HikeHaven.com


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