1

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

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 的经验也不是很丰富,所以我对这个错误的含义一无所知。

任何人都可以帮忙吗?

4

2 回答 2

7

我知道这个线程已经过时了,但我刚刚遇到了这个问题,并想帮助其他有问题的人。

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

希望这可以帮助。

于 2013-06-11T08:20:40.220 回答
1

我遇到了同样的问题,不幸的是我也无法解决它。正如 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 插件的作者。我最近没有做任何更改,但我找到了这个线程,因为我有一些正在进行中并遇到了这个问题;)

谢谢,布伦特

于 2010-05-31T19:39:47.260 回答