Mongodb 类问题的持久化单元

Mongodb 类问题的持久化单元,mongodb,kundera,nosql,Mongodb,Kundera,Nosql,我在一个Windows7框中使用昆德拉和mongodb。我正在尝试使用int数据类型。但是我得到了以下错误 Exception in thread "main" com.impetus.kundera.configure.schema.SchemaGenerationException: Persistence unit for class : int is not loaded at com.impetus.kundera.configure.SchemaConfiguration.p

我在一个Windows7框中使用昆德拉和mongodb。我正在尝试使用int数据类型。但是我得到了以下错误

Exception in thread "main" com.impetus.kundera.configure.schema.SchemaGenerationException: Persistence unit for class : int is not loaded
    at com.impetus.kundera.configure.SchemaConfiguration.parseRelations(SchemaConfiguration.java:262)
    at com.impetus.kundera.configure.SchemaConfiguration.configure(SchemaConfiguration.java:151)
    at com.impetus.kundera.configure.ClientMetadataBuilder.buildClientFactoryMetadata(ClientMetadataBuilder.java:48)
    at com.impetus.kundera.persistence.EntityManagerFactoryImpl.configureClientFactories(EntityManagerFactoryImpl.java:404)
    at com.impetus.kundera.persistence.EntityManagerFactoryImpl.configure(EntityManagerFactoryImpl.java:157)
    at com.impetus.kundera.persistence.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:131)
    at com.impetus.kundera.KunderaPersistence.createEntityManagerFactory(KunderaPersistence.java:85)
    at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
    at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
    at com.atomconnect.App.insertIntoMongo(App.java:37)
    at com.atomconnect.App.main(App.java:53)
我的persistence.xml如下所示

<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_1_0.xsd" version="2.0">
<persistence-unit name="ac">
    <provider>com.impetus.kundera.KunderaPersistence</provider>
    <properties>
        <property name="kundera.nodes" value="localhost" />
        <property name="kundera.port" value="12345" />
        <property name="kundera.keyspace" value="test" />
        <property name="kundera.dialect" value="mongodb" />
        <property name="kundera.client.lookup.class" value="com.impetus.client.mongodb.MongoDBClientFactory" />
        <property name="" value="datastore_mongo.jar"/>
       <!--  <property name="kundera.cache.provider.class" value="com.impetus.kundera.cache.ehcache.EhCacheProvider" />
        <property name="kundera.cache.config.resource" value="/ehcache-test.xml" /> -->
    </properties>
    <jar-file>target/test.jar</jar-file>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
 </persistence-unit>
</persistence>

com.property.kundera.kundera持久性
target/test.jar
真的
我为此浪费了2天时间,但没有找到解决方案。任何帮助都将不胜感激

您能尝试删除吗

property name=”“value=“datastore\u mongo.jar”


和共享test.jar实体代码?另外,您使用的是哪个版本的昆德拉?

我有一个类,我为它声明了从未使用过的int数据类型的一对一映射注释


这应该不会引起任何问题,但昆德拉通过反射填充元数据的方式是问题所在。

问题很可能与实体类的加载方式有关。是否可以尝试添加一次具有类标记中路径的实体类并尝试相同的操作?我删除了上述属性,但没有任何效果。它被加载到类路径中。只有在引入int数据类型时,才会出现此问题。否则它只能运行fineKundera和mongoDb版本?Kundera:2.11 mongoDb:mongoDb-win32-i386-2.6.3检查Github上的注释使用排除映射中的此类。这不是昆德拉的问题,但JPA是有效的
<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_1_0.xsd" version="2.0">
<persistence-unit name="ac">
    <provider>com.impetus.kundera.KunderaPersistence</provider>
    <properties>
        <property name="kundera.nodes" value="localhost" />
        <property name="kundera.port" value="12345" />
        <property name="kundera.keyspace" value="test" />
        <property name="kundera.dialect" value="mongodb" />
        <property name="kundera.client.lookup.class" value="com.impetus.client.mongodb.MongoDBClientFactory" />
        <property name="" value="datastore_mongo.jar"/>
       <!--  <property name="kundera.cache.provider.class" value="com.impetus.kundera.cache.ehcache.EhCacheProvider" />
        <property name="kundera.cache.config.resource" value="/ehcache-test.xml" /> -->
    </properties>
    <jar-file>target/test.jar</jar-file>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
 </persistence-unit>
</persistence>