【问题标题】:Can not makePersistent on GAE/J project with JDO2 on IntelliJ IDEA无法在 IntelliJ IDEA 上使用 JDO2 对 GAE/J 项目进行持久化
【发布时间】:2013-07-28 15:42:45
【问题描述】:

我尝试在 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;
    }
}

谢谢。

【问题讨论】:

    标签: java google-app-engine intellij-idea google-cloud-datastore jdo


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2018-04-04
      • 2011-02-15
      • 2017-01-18
      • 2013-10-07
      • 1970-01-01
      • 1970-01-01
      • 2019-12-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多