Daniel Ferreira
Daniel Ferreira

Reputation: 31

Kundera: error in the persistence configuration cassandra+eclipse+kundera

I have a problem with the persistence in my cassandra+kundera+eclipse project. The error that's reported is this:

log4j:WARN No appenders could be found for logger (com.impetus.kundera.KunderaPersistence). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Exception in thread "main" com.impetus.kundera.loader.PersistenceLoaderException: com.impetus.kundera.utils.InvalidConfigurationException: Could not find any META-INF/persistence.xml file in the classpath at com.impetus.kundera.configure.PersistenceUnitConfiguration.configure(PersistenceUnitConfiguration.java:100) at com.impetus.kundera.configure.Configurator.configure(Configurator.java:65) at com.impetus.kundera.KunderaPersistence.initializeKundera(KunderaPersistence.java:109) at com.impetus.kundera.KunderaPersistence.createEntityManagerFactory(KunderaPersistence.java:81) at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source) at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source) at controlador.Conetor.main(Conetor.java:17) Caused by: com.impetus.kundera.utils.InvalidConfigurationException: Could not find any META-INF/persistence.xml file in the classpath at com.impetus.kundera.configure.PersistenceUnitConfiguration.findPersistenceMetadatas(PersistenceUnitConfiguration.java:132) at com.impetus.kundera.configure.PersistenceUnitConfiguration.configure(PersistenceUnitConfiguration.java:83) ... 6 more

And the persistence source is this:

<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
    http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
    version="2.0">
    <persistence-unit name="cassandra_pu">
        <provider>com.impetus.kundera.KunderaPersistence</provider>     
        <properties>            
            <property name="kundera.nodes" value="localhost"/>
            <property name="kundera.port" value="9160"/>
            <property name="kundera.keyspace" value="KunderaExamples"/>
            <property name="kundera.dialect" value="cassandra"/>
            <property name="kundera.client.lookup.class"
                value="com.impetus.client.cassandra.thrift.ThriftClientFactory" />

        </properties>       
    </persistence-unit>
</persistence>

POM XML WITH DE JAR KUNDERA

Upvotes: 2

Views: 230

Answers (1)

Raj
Raj

Reputation: 115

Please put your persistence.xml in below path. It should resolve this error. src/main/resources/META-INF/persistence.xml

Upvotes: 1

Related Questions