0

我尝试在 IntelliJ IDEA 上使用 JDO2 创建一个新的 GAE/J 项目,但由于以下 org.datanucleus.jdo.exceptions.ClassNotPersistenceCapableException,它无法正常工作:

The class "Book" is not persistable. This means that it either hasnt been enhanced, or that the enhanced version of the file is not in the CLASSPATH (or is hidden by an unenhanced version), or the Meta-Data/annotations for the class are not found." is not persistable. This means that it either hasnt been enhanced, or that the enhanced version of the file is not in the CLASSPATH (or is hidden by an unenhanced version), or the Meta-Data for the class is not found.

我还尝试在 Eclipse 上创建完全相同的项目,它运行良好,没有任何问题。创建的模型很简单如下(我认为这个模型是无关的):

@PersistenceCapable
public class Book {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

    @Persistent
    private String name;

    public Book(String name) {
        this.name = name;
    }
}

谢谢。

4

1 回答 1

0

这意味着它要么没有被增强,要么文件的增强版本不在 CLASSPATH 中(或者被未增强的版本隐藏),或者找不到该类的元数据/注释。”不可持久. 这意味着它要么没有被增强,要么文件的增强版本不在 CLASSPATH 中(或者被未增强的版本隐藏),或者找不到该类的 Meta-Data。

恕我直言,该消息非常清楚。您必须在运行时增强您的类并在 CLASSPATH 中拥有增强版本。

于 2013-07-29T04:56:45.340 回答