Error deploying Seam 2.2 app on JBoss 7.1

好久不见. 提交于 2019-12-25 17:39:23

问题


I've been trying to deploy my JBoss Seam 2.2 application on JBoss 7.1. I've received some great advice and resources from my previous post, but now I'm encountering some errors. My application is using Hibernate/JPA 1.0 for persistence, along with Hibernate Search. When it gets to deploying the JAR in the EAR that contains my JPA entities, I see the following exception:

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.persistenceunit."MyApp-ear.ear/MyApp-entities.jar#MyApp": org.jboss.msc.service.StartException in service jboss.persistenceunit."MyApp-ear.ear/MyApp-entities.jar#MyApp": 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:886) [classes.jar:1.6.0_29]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_29]
    at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_29]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: MyApp] 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.event.service.spi.EventListenerRegistrationException: Listener did not implement expected interface [org.hibernate.event.spi.PostUpdateEventListener]
    at org.hibernate.event.service.internal.EventListenerGroupImpl.checkAgainstBaseInterface(EventListenerGroupImpl.java:168)
    at org.hibernate.event.service.internal.EventListenerGroupImpl.internalAppend(EventListenerGroupImpl.java:175)
    at org.hibernate.event.service.internal.EventListenerGroupImpl.appendListener(EventListenerGroupImpl.java:109)
    at org.hibernate.ejb.event.JpaIntegrator.integrate(JpaIntegrator.java:137)
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:294)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737)
    at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)

I didn't see any mention of changes I needed to make to support JPA 1.0 in the resources that were provided to me in my previous question. Does anyone have any idea what is causing this error? Is it due to my usage of Hibernate Search?

EDIT: I should mention the version of Hibernate that I am using is the one bundled with Seam 2.2. It is version 3.3.1.


回答1:


Okay, I've resolved the issue. Apparently there is a known problem with the versions of Hibernate, Hibernate Search, and Lucene that are shipped with Seam 2.2. However, because of the new classloading features in JBoss 7.x it was easy to upgrade them. I dropped in Hibernate 3.6.10 and the corresponding Hibernate Search and Lucene libraries and it more or less worked. There were a couple of minor tweaks I had to make to the configuration, but those are documented in the JBoss 7.1 JPA guide.



来源:https://stackoverflow.com/questions/9833537/error-deploying-seam-2-2-app-on-jboss-7-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!