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>
>
before each line. The StackOverflow built-in editor has buttons for doing those things; you just highlight your code snippet or error message, and press the button, and it does the rest for you. – sideshowbarkerpersistence.xml
? It should be in the classpath (preferably src/main/resources) inMETA-INF
folder. Eg:src/main/resources/META-INF/persistence.xml
– karthik manchalaKundera 3.1
– karthik manchala