- This topic has 1 reply, 2 voices, and was last updated 17 years, 7 months ago by Riyad Kalla.
-
AuthorPosts
-
carribbeanfeverMember– System Setup ——————————-
Operating System and version: Windows xp pro sp2
Eclipse version:
Eclipse build id:
Fresh Eclipse install (y/n): n
If not, was it upgraded to its current version using the update manager? Yes
Other installed external plugins: none
Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*:
MyEclipse version: 5.1.1 GA
Eclipse JDK version: 20070302-5.1.1-GA
Application Server JDK version: Java EE 5 SDK
Are there any exceptions in the Eclipse log file?– Message Body ——————————-
I went thru the hibernate demo help but when I finished and ran the HibernateReadTest.java as it suggested I got errors. I am assuming the instructions left something out. Here is the message stream I got:
log4j:WARN No appenders could be found for logger (com.genuitec.hibernate.EchoMessageDAO).
log4j:WARN Please initialize the log4j system properly.
%%%% Error Creating SessionFactory %%%%
org.hibernate.MappingException: Association references unmapped class: com.genuitec.hibernate.Inventory
at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2344)
at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2618)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1012)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1168)
at com.genuitec.hibernate.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:60)
at com.genuitec.hibernate.HibernateSessionFactory.getSession(HibernateSessionFactory.java:43)
at com.genuitec.hibernate.BaseHibernateDAO.getSession(BaseHibernateDAO.java:13)
at com.genuitec.hibernate.EchoMessageDAO.findById(EchoMessageDAO.java:48)
at com.genuitec.hibernate.HibernateReadTest.main(HibernateReadTest.java:12)
%%%% Error Creating SessionFactory %%%%
org.hibernate.MappingException: Could not read mappings from resource: com/genuitec/hibernate/EchoMessage.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:485)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1310)
at com.genuitec.hibernate.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:59)
at com.genuitec.hibernate.HibernateSessionFactory.getSession(HibernateSessionFactory.java:43)
at com.genuitec.hibernate.BaseHibernateDAO.getSession(BaseHibernateDAO.java:13)
at com.genuitec.hibernate.HibernateReadTest.main(HibernateReadTest.java:20)
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.genuitec.hibernate.EchoMessage
at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:154)
at org.hibernate.cfg.Configuration.add(Configuration.java:386)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)
… 9 more
Exception in thread “main” java.lang.NullPointerException
at com.genuitec.hibernate.EchoMessageDAO.findById(EchoMessageDAO.java:49)
at com.genuitec.hibernate.HibernateReadTest.main(HibernateReadTest.java:12)
Riyad KallaMemberDoes this file exist?
com/genuitec/hibernate/EchoMessage.hbm.xml -
AuthorPosts