在JBoss 7.1上部署Seam 2.2应用程序时出错

时间:2012-03-23 02:51:17

标签: hibernate jboss seam jboss7.x hibernate-search

我一直在尝试在JBoss 7.1上部署我的JBoss Seam 2.2应用程序。我从my previous post收到了一些很好的建议和资源,但现在我遇到了一些错误。我的应用程序使用Hibernate / JPA 1.0进行持久化,以及Hibernate Search。当它在包含我的JPA实体的EAR中部署JAR时,我看到以下异常:

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)

在上一个问题中提供给我的资源中,我没有看到我需要做出哪些更改来支持JPA 1.0。有谁知道是什么导致了这个错误?是因为我使用了Hibernate Search吗?

编辑:我应该提一下我使用的Hibernate版本是与Seam 2.2捆绑在一起的版本。它是版本3.3.1。

1 个答案:

答案 0 :(得分:0)

好的,我已经解决了这个问题。显然,Seam 2.2附带的Hibernate,Hibernate Search和Lucene版本存在已知问题。但是,由于JBoss 7.x中的新类加载功能,很容易升级它们。我放弃了Hibernate 3.6.10以及相应的Hibernate Search和Lucene库,它或多或少都有效。我必须对配置进行一些小的调整,但这些都在JBoss 7.1 JPA指南中有记录。