2

私はJavaとJavaEEにかなり慣れていません。プロジェクトに取り組んでおり、JPA(MySQLの場合はhibernate、Cassandraの場合はKundera)を実装する2つのdataSources(MySQL + Cassandra)を使用したいと考えています。私のpersistence.xmlは次のとおりです。

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
    version="2.0">
    <persistence-unit name="mysqlPU" transaction-type="JTA">
        <description>MySQL Persistent Unit</description>
        <jta-data-source>java:jboss/datasources/MySQLRemote</jta-data-source>
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>com.eventit.entities.Event</class>
    <class>com.eventit.entities.Group_icon</class>
    <class>com.eventit.entities.Group</class>
    <class>com.eventit.entities.User</class> 
    </persistence-unit>
<persistence-unit name="cassandraPU">
    <provider>com.impetus.kundera.KunderaPersistence</provider>
    <properties>
        <property name="kundera.nodes" value="10.0.0.13" />
        <property name="kundera.port" value="9160" />
        <property name="kundera.keyspace" value="KunderaKeyspace" />
        <property name="kundera.dialect" value="cassandra" />
        <property name="kundera.client.lookup.class"
            value="com.impetus.client.cassandra.pelops.PelopsClientFactory" />
        <property name="kundera.cache.provider.class"
            value="com.impetus.kundera.cache.ehcache.EhCacheProvider" />
        <property name="kundera.cache.config.resource" value="/ehcache-test.xml" />
    </properties>
</persistence-unit>

しかし、プロジェクトをJBoss(AS 7.1)にデプロイすると、次のエラーが発生します。

02:56:22,428 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.unit."Event-it5.5.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."Event-it5.5.jar".INSTALL: Failed to process phase INSTALL of deployment "Event-it5.5.jar"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
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]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_04]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]
Caused by: javax.persistence.PersistenceException: JBAS011466: PersistenceProvider 'com.impetus.kundera.KunderaPersistence' not found
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.lookupProvider(PersistenceUnitDeploymentProcessor.java:555)
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deployPersistenceUnit(PersistenceUnitDeploymentProcessor.java:295)
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:258)
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleJarDeployment(PersistenceUnitDeploymentProcessor.java:145)
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:120)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more

mysqlPUは問題なく動作しますが、cassandraPUを追加すると例外が発生します。http://127.0.0.1:9990/console/App.html#deployments 事前にThanksでjarを確認でき、必要なものをすべて提供できれば、jbossへの依存関係を持つkundera.jarを正しくデプロイしていると確信しています。

4

1 に答える 1

2

お役に立てれば。

https://groups.google.com/forum/#!msg/kundera-discuss/3-iUJQOShvE/kJihv32IbjYJ

見てください。

-Vivek

于 2012-06-25T19:14:40.587 に答える