简体   繁体   中英

Datanucleus enhancer fails with class not found exception on Eclipse with GAE plugin

I have Eclipse with the Google App Engine plugin installed. Until recently the Datanucleus enhancer, which is run automatically when classes are saved worked nicely.

One of my entity classes has since grown slightly more complicated with the introduction of a member of a type, that resides inside an external library located in the project's lib-directory.

The field in question is marked with the @Transient annotation, but still the Datanucleus enhancer tries in vain to find the class in question. Apparently the jar-files in the project's lib-directory aren't scanned for dependencies.

Is there a way to define the classpath for the Datanucleus enhancer?

After reviewing some other related questions and browsing through Eclipse's settings (the GAE-related ones) I've come to the conclusion that there probably is no easy way to specify classpath directly.

The simplest and most elegant way I was able to come up with was to disable automatic Datanucleus enhancement, and introduce an Ant task to do this.

The approved answer to the question Add scala class to DataNucleus enhancer CLASSPATH turned out to be particularly helpful.

I wrote an Ant build file nearly identical to the one presented in the linked question and it solved my problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM