-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate from JBoss 4.2.2 to JBoss 7.1.1 with Hibernate
PostPosted: Mon Jul 01, 2013 11:10 am 
Newbie

Joined: Wed Sep 10, 2008 2:02 pm
Posts: 14
Location: NJ
Hi. I've got 73 hbm.xml files that describe persistent entities in an application that has been deployed to JBoss 4.2.2 for many years. I'm attempting to port to JBoss 7.1.1 with whatever version of Hibernate is included. The hbm.xml files used to be in the jar file that contained the classes that implemented the model. Hibernate read the files when the ear was loaded. This no longer happens. I've read that most people put their persistence.xml file in a separate jar to be packaged in the ear's lib directory. I've followed suit. hbm.xml files were still not being read by Hibernate, and I couldn't figure out how to tell Hibernate where they were, so I tried moving the hbm.xml files to the jar file that contains the persistence.xml. Now the hbm.xml files are being read, but references to other classes from within the hbm.xml files are failing:

10:49:36,084 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.persistenceunit."appEar.ear#app": org.jboss.msc.service.StartException in service jboss.persistenceunit."appEar.ear#app": Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_51]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_51]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: app] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
... 3 more
Caused by: org.hibernate.MappingException: Association references unmapped class: com.app.session.common.Note
at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2453)
at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2730)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:66)
at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1586)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1359)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1724)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
... 9 more

Am I going about this the right way? Do I need to establish a classpath for the jar that contains persistence.xml that allows the com.app.session.common classes to be resolved?

Thanks for any advice.

Richard


Top
 Profile  
 
 Post subject: Re: Hibernate from JBoss 4.2.2 to JBoss 7.1.1 with Hibernate
PostPosted: Mon Jul 01, 2013 11:40 am 
Newbie

Joined: Wed Sep 10, 2008 2:02 pm
Posts: 14
Location: NJ
Never mind. The error was in regard to an unmapped class. I found that I missed a few of my hbm.xml files when I copied them over from the original location.


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