【问题标题】:Hudson plugin, Java error "... disagree on InnerClasses attribute"Hudson 插件,Java 错误“...不同意 InnerClasses 属性”
【发布时间】:2010-04-22 09:41:56
【问题描述】:

我正在尝试能够单步执行名为 SVNPublisher 的 Hudson 插件的代码。我检查了 SVNPublisher 的代码,使用 Netbeans 打开项目,然后单击“调试主项目”。这会导致 Firefox 窗口打开地址 http://localhost:8080 显示 Hudson 主页。点击“New Job”链接会导致错误页面:

HTTP ERROR: 500

jar:file:/home/francis/svn/svnpublisher/target/work/webapp/WEB-INF/lib/hudson-core-1.319.jar!/lib/hudson/newFromList/form.jelly:43:47: <j:forEach> hudson.scm.SubversionTagAction and hudson.scm.SubversionTagAction$DescriptorImpl disagree on InnerClasses attribute

RequestURI=/newJob
Caused by:

org.apache.commons.jelly.JellyTagException: jar:file:/home/francis/svn/svnpublisher/target/work/webapp/WEB-INF/lib/hudson-core-1.319.jar!/lib/hudson/newFromList/form.jelly:43:47:  hudson.scm.SubversionTagAction and hudson.scm.SubversionTagAction$DescriptorImpl disagree on InnerClasses attribute
    at org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:713)
    at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:282)
    at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
    ...

我对 Hudson 很陌生,对 Java 的经验也不是很丰富,所以我对这个错误的含义一无所知。

谁能帮忙?

【问题讨论】:

标签: java hudson hudson-plugins


【解决方案1】:

我知道这个帖子已经很老了,但我刚刚遇到这个问题,想帮助其他有问题的人。

我发现当我在一个类中有一个 DescriptorImpl 时遇到了这个问题(这是主类的子类)。在我的情况下,这是 ResourceAxis 包含 DescriptorImpl。

当我将 DescriptorImpl 重命名为 ResourceDescriptorImpl 时,我开始遇到此问题。然后我开始收到以下错误消息:

Error injecting constructor, java.lang.IncompatibleClassChangeError: org.jenkinsci.plugins.matrix_resource_manager.ResourceAxis and org.jenkinsci.plugins.matrix_resource_manager.ResourceAxis$DescriptorImpl disagree on InnerClasses attribute
at org.jenkinsci.plugins.matrix_resource_manager.ResourceAxis$DescriptorImpl.<init>(ResourceAxis.java:94)

这促使我将 ResourceDescriptorImpl 改回 DescriptorImpl - 因为它在抱怨 DiscriptorImpl。那时我收到了这个错误信息:

Error injecting constructor, java.lang.IncompatibleClassChangeError: org.jenkinsci.plugins.matrix_resource_manager.ResourceAxis and org.jenkinsci.plugins.matrix_resource_manager.ResourceAxis$ResourceDescriptorImpl disagree on InnerClasses attribute
at org.jenkinsci.plugins.matrix_resource_manager.ResourceAxis$ResourceDescriptorImpl.<init>(ResourceAxis.java:94)

这个人在抱怨 ResourceDescriptorImpl。我意识到我每次都没有进行干净的构建,并且旧的编译代码可能会导致问题(因为我只更改了一个类,因此可能无法重新编译另一个类)。如果您看到此问题,请尝试进行干净的构建,看看是否能解决您的问题。

希望这会有所帮助。

【讨论】:

    【解决方案2】:

    我遇到了同样的问题,不幸的是我也无法解决它。正如 VonC 提到的,这可能与 1.5 和 1.6 之间泛型使用方式的变化有关,这是有问题的,因为即使您安装 1.5 版本的 hudson 也需要 1.6 才能通过 hpi:run 构建和运行。

    我注意到的是,如果您在本地安装 hudson (http://wiki.hudson-ci.org/display/HUDSON/Meet+Hudson#MeetHudson-TestDrive),您可以使用 maven install 命令生成插件的 .hpi 文件并安装它。当我这样做时,我没有得到同样的错误,这让我认为这可能是 hpi:run 目标的问题。这至少应该让您测试您需要进行的任何更改。

    巧合的是,如果您有任何问题,我是那个 SVN Publish 插件的作者。我最近没有做任何更改,但我发现了这个线程,因为我有一些在工作中并遇到了这个问题;)

    谢谢, 布伦特

    【讨论】:

    • 另外,作为说明,我尝试使用其他几个插件并得到相同的结果,这让我认为这是一个更普遍的问题。
    • 感谢您的回复。事实证明,只有在使用 Netbeans 的嵌入式 Hudson 服务器时才会出现问题。在实际的构建服务器上它运行良好。
    猜你喜欢
    • 2016-10-03
    • 2019-02-14
    • 2016-07-29
    • 2017-02-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多