【问题标题】:Can DataNucleus Enhancer process classes that are in jar on a classpath?DataNucleus Enhancer 可以处理类路径上 jar 中的类吗?
【发布时间】:2011-10-12 04:59:57
【问题描述】:

有一个 Google App Engine Java 项目“A”基于另一个 Google App Engine Java“B”中的大部分类,但不是全部。

为此,项目“B”中的所有这些类都作为 Jar 导出,源代码包含在项目“A”的类路径中,其中有几个 @Entity 类。

在本地调试模式下运行项目“A”时,我得到了

java.lang.RuntimeException: Class UserAccount for query has not been resolved. Check the query and any imports specification
    at biz.daich.gwt.common.app.server.domain.services.UserAccountService.findOrCreateUserAccountByPrimaryEmail(UserAccountService.java:123)
    at biz.daich.gwt.common.app.server.domain.services.UserAccountService.getCurrentLogIn(UserAccountService.java:312)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)......

这是有道理的,因为 DataNucleus Enhancer 没有增强 UserAccount 类,因为它不在要增强的文件列表中。

如何配置 Google Plugin/Google App Engine/DataNucleus Enhancer 以对这些类执行字节码增强,就像我在 Eclipse Project Properties -> Google -> App Engine 中按模式选择的类一样-> ORM ?

这样可以吗?

    If YES: How to define a pattern?

    If NO: How can I link few classes from another project, not even a whole package, in to the source tree of this project that will do the trick?

【问题讨论】:

    标签: java eclipse google-app-engine datanucleus


    【解决方案1】:

    无法使用新字节码更新 jar 中的类;除了解开它们,增强它们,再改变它们。

    【讨论】:

    • 是否可以在构建项目B时对其进行增强,使项目A中使用的project-B.jar已经具有增强的字节码?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-22
    • 2013-08-03
    • 1970-01-01
    • 2016-09-04
    • 2015-04-01
    • 2014-03-11
    • 1970-01-01
    相关资源
    最近更新 更多