2011-09-30 89 views
0

我正在從jboss 5.1遷移到6.1。我有一個擁有一些EJB和一場戰爭的耳朵。在6.1中部署後出現以下錯誤。遷移到jboss 6.1時的EJB部署錯誤

12:00:23,184 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=ZServer.ear/#ZPersistCtx 
12:00:23,204 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=ZServer.ear/#ZPersistCtx state=Create: java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot be cast to javax.persistence.spi.PersistenceProvider 
     at org.jboss.jpa.builder.DefaultCEMFBuilder.build(DefaultCEMFBuilder.java:46) [:1.0.2-alpha-4] 
     at org.jboss.as.jpa.scanner.HackCEMFBuilder.build(HackCEMFBuilder.java:49) [:6.1.0.Final] 
     at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:275) [:1.0.2-alpha-4] 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26] 
     . 
     . 
     . 
     at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2] 
     at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.1.0.Final] 
     at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final] 
     at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6] 
     at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6] 
     at java.lang.Thread.run(Thread.java:662) [:1.6.0_26] 

12:00:23,442 INFO [EJBContainer] STARTED EJB: com.al.sqlgen.ejb.ResponseListnerMDBBean ejbName: ResponseListnerMDBBean 
12:00:23,751 WARN [TimerServiceContainer] EJBTHREE-2193: using deprecated TimerServiceFactory for restoring timers 

我在耳朵裏有下面的庫。

[email protected]:~/usr/local/jboss-6.1.0.Final/server/all/deploy/ZServer.ear/lib> ls 
antlr-2.7.6.jar    flex-messaging-remoting.jar 
asm-attrs.jar     hibernate3.jar 
asm.jar      hibernate-annotations.jar 
cglib-2.1.3.jar    hibernate-commons-annotations.jar 
commons-collections-2.1.1.jar hibernate-entitymanager.jar 
commons-io-1.4.jar    hibernate-tools.jar 
commons-logging-1.1.jar  HsmSEE.jar 
dom4j-1.6.1.jar    javassist.jar 
ehcache-1.2.3.jar    jdbc2_0-stdext.jar 
ejb3-persistence.2.jar   jta.jar 

我試圖改變分類裝載過程如前所述here但仍然得到同樣的錯誤。感謝有人能幫助我解決這個問題。

+0

我會嘗試從您的.ear文件中刪除Hibernate庫並使用JBoss Hibernate庫。 –

+0

我刪除了瓶子,並做了http://www.mastertheboss.com/hibernate/326-using-hibernate-second-level-cache-with-jboss-as-5-6-7.html中提出的更改。它正在工作。謝謝! – Dohan

回答

0

我刪除了罐子,並做了修改建議mastertheboss.com/hibernate/...。它正在工作。謝謝!