0

I want to use Infinispan with hibernate second level cache. My application is running in a glassfish 3 application server and I use hibernate JPA. The hibernate library already contains infinispan so I didn't added to my project. I use jta transaction. To do that I modify my persistence.xml:

        <!-- Infinispan second level cache configuration  -->
        <property name="hibernate.cache.use_second_level_cache" value="true"/>
        <property name="hibernate.cache.use_query_cache" value="true"/>
        <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.infinispan.InfinispanRegionFactory"/>
        <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>

When I redeploy the application I get the following exception:

java.lang.NoClassDefFoundError: org/infinispan/transaction/lookup/TransactionManagerLookup

Should I try to add the infinispan library to the project?

I tried to set:

<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>

but didn't worked.

Thanks in advance.

4

1 回答 1

0

好吧,我的错。我制作了一个用户库并将所有必要的 jar 文件放入其中。在 Eclipse 中,我添加了项目构建路径,但我忘记将库复制到 glassfish 库。为此,请再次打开项目构建路径,选择部署程序集并将用户库添加到部署路径。之后一切都应该好了。

于 2011-11-10T21:43:44.387 回答