JBAS011466:来自kundera 2.7.1的PersistenceProvider'com.impetus.kundera.KunderaPersistence'未找到错误

时间:2013-12-27 18:53:09

标签: jboss7.x kundera

我是jBoss(7.1)和Kundera(2.7.1)的新手,我正在研究一个项目,我想使用Cassandra dataSource使用Kundera实现JPA。我的persistence.xml如下:

<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br/>
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence<br/>
    http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"<br/>
    version="1.0"><br/>
    <persistence-unit name="cassandra_pu"><br/>
        <provider>com.impetus.kundera.KunderaPersistence</provider><br/>
        <properties><br/>
            <property name="kundera.nodes" value="localhost" /><br/>
            <property name="kundera.port" value="9160" />
            <property name="kundera.keyspace" value="ech" />
            <property name="kundera.dialect" value="cassandra" />
            <property name="kundera.client.lookup.class" value="com.impetus.client.cassandra.thrift.ThriftClientFactory" />
            <property name="kundera.cache.provider.class" value="com.impetus.kundera.cache.ehcache.EhCacheProvider"/>
            <property name="kundera.cache.config.resource" value="/ehcache-test.xml" />
            <!--  <property name="jboss.as.jpa.managed" value="false"/>-->
        </properties>
    </persistence-unit>
   </persistence>

我的applicationContext.xml如下

    ?<?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

    <bean id="personDAO" class="com.impetus.kundera.examples.spring.PersonDAO">
        <property name="entityManagerFactory" ref="entityManagerFactory" />
    </bean>     
    <bean id="entityManagerFactory"
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="persistenceUnitName" value="cassandra_pu" />
    </bean> 
</beans>

当我从persistence.xml中删除“jboss.as.jpa.managed = false”属性时,我收到 JBAS011466:PersistenceProvider'com.impetus.kundera.KunderaPersistence'not found 错误,如果我放置“jboss.as.jpa.managed = false”属性,我最终用没有持久性单位,名称'cassandra_pu'发现错误

完成两个错误的跟踪:

找不到名为'cassandra_pu'的持久性单元--- persistence.xml包含属性name =“jboss.as.jpa.managed”value =“false”

  

引起:java.lang.IllegalArgumentException:找不到名为'cassandra_pu'的持久性单元     在org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.obtainPersistenceUnitInfo(DefaultPersistenceUnitManager.java:566)[spring-orm-3.2.4.RELEASE.jar:3.2.4.RELEASE]     在org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.determinePersistenceUnitInfo(LocalContainerEntityManagerFactoryBean.java:308)[spring-orm-3.2.4.RELEASE.jar:3.2.4.RELEASE]     在org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:260)[spring-orm-3.2.4.RELEASE.jar:3.2.4.RELEASE]     在org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)[spring-orm-3.2.4.RELEASE.jar:3.2.4.RELEASE]     在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)[spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]     在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)[spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]     ......还有20个

JBAS011466:未找到PersistenceProvider'com.impetus.kundera.KunderaPersistence'---从persistence.xml中删除 - property name =“jboss.as.jpa.managed”value =“false”

  

引起:javax.persistence.PersistenceException:JBAS011466:未找到PersistenceProvider'com.impetus.kundera.KunderaPersistence'     在org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.lookupProvider(PersistenceUnitDeploymentProcessor.java:560)     在org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deployPersistenceUnit(PersistenceUnitDeploymentProcessor.java:297)     在org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:260)     在org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleEarDeployment(PersistenceUnitDeploymentProcessor.java:218)     在org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:121)     在org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116)[jboss-as-server-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]     ......还有5个

罐子里的罐子是

cassandra-connection-pool-0.7.1.jar
commons-lang-2.4.jar
commons-logging-1.1.1.jar
commons-pool-1.2.jar
guava-14.0.1.jar
hibernate-commons-annotations-4.0.2.Final.jar
hibernate-core-4.2.3.Final.jar
javassist-3.15.0-GA.jar
jta-1.1.jar
jts-1.11.jar
kundera-cassandra-2.7.1.jar
kundera-core-2.7.1.jar
lucene-core-3.5.0.jar
persistence-api-1.0.jar
slf4j-api-1.7.2.jar
spring-beans-3.0.0.RELEASE.jar
spring-context-3.0.0.RELEASE.jar
spring-core-3.0.0.RELEASE.jar
spring-jdbc-3.0.0.RELEASE.jar
spring-orm-3.0.0.RELEASE.jar
spring-tx-3.0.0.RELEASE.jar

PS - 我在\ JBOSS_HOME&gt; \ modules \ org \ apache下没有任何jpa相关文件夹,我的persistence.xml存在于MyEAR.ear&gt; META-INF&gt; persistence.xml(以及application.xml)下,jboss-deployment-structure.xml和MANIFEST.MF)

希望我已经提供了所有必要的信息。我在这一整天都被困住了。任何帮助都非常感谢。谢谢。