0

我嘗試在IntelliJ IDEA上使用JDO2創建新的GAE/J項目,但由於以下原因,它不能正常工作org.datanucleus.jdo.exceptions.ClassNotPersistenceCapableException :在IntelliJ IDEA上不能使用JDO2的GAE/J項目

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; 
    } 
} 

謝謝。

回答

0

這意味着,它或者處理不當得到增強,或者說,加強 版本的文件不在CLASSPATH(或由 未增強版本隱藏),或者爲類元數據/註釋「 未找到」,這意味着它不是 增強,或者文件的增強版本不在 CLASSPATH中(或被未增強版本隱藏)或元數據 找不到類

消息是pret ty清晰恕我直言。您必須增強您的類並在運行時在CLASSPATH中擁有增強版。