简体   繁体   English

Datanucleus增强器失败,带有带有GAE插件的Eclipse上的类未找到异常

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

I have Eclipse with the Google App Engine plugin installed. 我有安装了Google App Engine插件的Eclipse。 Until recently the Datanucleus enhancer, which is run automatically when classes are saved worked nicely. 直到最近,Datanucleus增强器在保存类时自动运行良好。

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. 此后,由于引入了类型的成员(位于项目的lib目录中的外部库中),我的一个实体类变得有些复杂。

The field in question is marked with the @Transient annotation, but still the Datanucleus enhancer tries in vain to find the class in question. 有问题的字段标有@Transient批注,但Datanucleus增强程序仍然徒劳地寻找有问题的类。 Apparently the jar-files in the project's lib-directory aren't scanned for dependencies. 显然,不会扫描项目lib目录中的jar文件。

Is there a way to define the classpath for the Datanucleus enhancer? 有没有一种方法可以为Datanucleus增强程序定义类路径?

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. 在回顾了其他一些相关问题并浏览了Eclipse的设置(与GAE相关的设置)之后,我得出的结论是,可能没有简单的方法可以直接指定类路径。

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. 我能够想到的最简单,最优雅的方法是禁用自动Datanucleus增强,并引入一个Ant任务来执行此操作。

The approved answer to the question Add scala class to DataNucleus enhancer CLASSPATH turned out to be particularly helpful. 事实证明,将scala类添加到DataNucleus增强器CLASSPATH的问题的答案特别有用。

I wrote an Ant build file nearly identical to the one presented in the linked question and it solved my problem. 我写了一个与链接问题中介绍的文件几乎相同的Ant构建文件,它解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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