Can not makePersistent on GAE/J project with JDO2

Hello,

I love Android Studio, so I'm using "Ultimate Edition" to develop GAE/J projects for trial now.

I tried creating a new GAE/J project with JDO2 on IntelliJ IDEA, but it does not work well because of the following 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.


I also tried creating the same project on Eclipse and it works well without any problems. The created model is very simple as follows (I think this model is non-related):

@PersistenceCapable

public class Book {

    @PrimaryKey

    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)

    private Key key;

    @Persistent

    private String name;

    public Book(String name) {

        this.name = name;

    }

}

If I can fix this issue on IntelliJ IDEA, I want to buy a Personal License. I would appreciate it if you could let me know how to fix this issue.

Thanks.

6 comments

Hello,

please open File | 'Project Structure' dialog, select 'Modules' item, choose 'Google App Engine' node under the module node and ensure that 'Run
enhancer for ...' checkbox is selected and the root containing your classes is added to the table below.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Hello Nikolay,

Thank you very much for your response.

I checked the settings again, and it seems that it's already correct as you advices. I attached the screenshot. I'm using IntelliJ IDEA ver.12.1.4 on Mac.

I would appreciate it if you could create a new project on the same environment with JDO and check if it works without any errors.

Thanks.



Attachment(s):
jdo.png
0

Hello,

please do the following:
1) replace 'info' by 'debug' in  tag in log/build-log/build-log.xml file (you can use Help | 'Show Log' to locate the 'log'
directory)
2) invoke Build | 'Rebuild Project'
3) attach here (or send to Nikolay.Chashnikov@jetbrains.com) log/build-log/build.log file.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Hello Nikolay,

I sent a message to your email address in a few minutes ago with the log file and the project directory itself I created with IntelliJ IDEA.

Would you please check them?

Thank you very much for your support.

0

It seems that JDO Enhancer doesn't work for classes from the default package. To fix the problem move 'Book' class to some package.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Wow, it works now without exceptions by moving codes to created package.

Thank you so much! I'll purchase a license!

0

Please sign in to leave a comment.