This is probably failing because you have com/igt/atg/persistance/common/IbeCityMasters.hbm.xml defined twice in hibernate.cfg.xml. Check there is only one mapping in there.
So there is an issue with the IbeCityMasters.hbm.xml. Either it is somehow declared twice like Paul had mentioned, or there is something wrong with the mapping of the class. Please also post the IbeCityMasters.hbm.xml,
Very interesting, after trying to read Hibernate's code and manually step through, I find that the addImport method of the Mappings.java file is called when there is an "import" tag in your mapping files, either the hibernate.cfg.xml or the IbeCityMasters.hbm.xml file.
I actually don't know the "import" tag. So then my question would be why do you use that tag? And I could be completely wrong in my assumption here, and missed some other place in the Hibernate code where the addImport method is being called, but I doubt that right now. Or is auto-import set in your mapping to true?
I love questions like this that allow me to go into the Hibernate code and search for the answer, it really helps me learn about how Hibernate is build. It is really cool and very very very well written, very OO, simple, and general whenever possible for extensibility.
There is no any 'import' in .cfg.xml OR .hbm.xml. But I got a that hibernate is reading the configuration file twice at time of initilizing. (Check code)
- I'm putting contents of IBECity to app. cache at start using struts+hibenate. - We are using struts -> EJB -> DAO -> Hibernate -> Oracle 10g. (using lazy="false"..it still confuse sometimes..throwing large chunk of SQL..) - If we not closing seesion in DAO..it gives error while saving...!!
Here is log output: --------------------
- Help me where I'm wrong?
Raminder Singh
Ranch Hand
Joined: Mar 01, 2002
Posts: 72
posted
0
Sorry, forgot earlier to share. Here is HibernateSessionFactory File. -----------------------------------
Going by the exception stacktrace its appears to be related to wrong version of a jar being present in the classpath. Make sure you are using the correct version of asm.jar and asm-attrs.jar. Also make sure that you dont have multiple such jars in your classpath.