开发者

EclipseLink to Hibernate migration

I'm trying to migrate enterprise application which was built for Glassfish3 + EclipseLink to JBoss7 + Hibernate.

When I'm tr开发者_运维百科ying to enable my application, the persistence unit does not start, throwing this exception

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.persistenceunit."app-logic.ear/domain-jpa-ejb.jar#dataspace-PU": org.jboss.msc.service.StartException in service jboss.persistenceunit."app-logic.ear/domain-jpa-ejb.jar#dataspace-PU": Failed to start service
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1780)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
        at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
Caused by: java.lang.NullPointerException
        at org.hibernate.annotations.CacheConcurrencyStrategy.fromAccessType(CacheConcurrencyStrategy.java:52)
        at org.hibernate.cfg.AnnotationBinder.determineCacheConcurrencyStrategy(AnnotationBinder.java:1038)
        at org.hibernate.cfg.AnnotationBinder.buildCacheMock(AnnotationBinder.java:1005)
        at org.hibernate.cfg.AnnotationBinder.determineCacheSettings(AnnotationBinder.java:962)

Did anything similar happened to you? Seems weird to me, that NullPointerException is thrown. I tried to inspect whats' on the line 52 in CacheConcurrencyStrategy, but it doesn't seem able to throw such exception.

Note that I'm not using any persistence-provider specific annotations.

Thanks


Seems that some update of library fixed this issue. Anyway if anyone will have similar problem, please let me know. I'm interested where the problem really was.


A previous bug in hibernate 4.1 has been fixed. Nevertheless, I had similar problem on 4.2, JBoss7.1 / maybe it was same as yours.

In persistence.xml, I have set

<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>

AND NEED specify

<property name="hibernate.cache.use_second_level_cache"
                value="true" />

otherwise, I get

Caused by: java.lang.NullPointerException
        at org.hibernate.annotations.CacheConcurrencyStrategy.fromAccessType(CacheConcurrencyStrategy.java:52)

I hope this may help anybody else ?!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜