在Eclipse中的junit蚂蚁生成错误 [英] ant junit build error inside eclipse

查看:203
本文介绍了在Eclipse中的junit蚂蚁生成错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有一些人谁看见了,对,我有现在与Ant脚本中的问题的解决方案。我使用Ant脚本来编译我的Java codeS在日食月食,但一直给我的这些错误

I am hoping there are some people who have seen and have a solution for the problem that I am having right now with ant script. I am using an ant script to compile my java codes in eclipse but eclipse keeps giving me these errors

[junitreport] Processing E:\workspace\DataOrchestrationDevelopment\DataOrchestration\Logs\jsreports\junit\html\TESTS-TestSuites.xml to C:\Users\u0160235\AppData\Local\Temp\null1503375679
[junitreport] Loading stylesheet jar:file:/E:/software/apache/apache-ant-1.8.2/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] : Error! The first argument to the non-static Java function 'replace' is not a valid object reference.
[junitreport] : Error! Cannot convert data-type 'void' to 'reference'.
[junitreport] : Fatal Error! Could not compile stylesheet
[junitreport] Failed to process E:\workspace\DataOrchestrationDevelopment\DataOrchestration\Logs\jsreports\junit\html\TESTS-TestSuites.xml

BUILD FAILED
E:\workspace\DataOrchestrationDevelopment\DataOrchestration\ant\developerbuild.xml:124: The following error occurred while executing this line:
E:\workspace\DataOrchestrationDevelopment\DataOrchestration\ant\QunitAntScript.xml:20: Errors while applying transformations: Fatal error during transformation

我的环境设置:


  • Windows 7中

  • 的Eclipse 3.6 RC2 32位

  • JDK 1.6更新32的32位

  • 蚂蚁1.7.2

  • JUnit 4中(Eclipse中):在我的项目文件夹罐子我的JUnit-DEP-4.8.2.jar

一件事一提的是,如果我使用相同的ant脚本编译我的codeS外食,一切都运行得很好,但它并没有在Eclipse中工作。我试图谷歌上面的样式表,上面的错误,但没有帮助我很多。我的猜测是不知何故,在使用日食不同JUnit版本是,但我可能是错的。

One thing to mention that if I compile my codes outside eclipse using the same ant script, everything works just fine, but it doesn't work inside eclipse. I tried to google the errors above the stylesheet above, but that didn't help me much. My guess is somehow, within eclipse different version of junit is being used, but I might be wrong.

推荐答案

我用下面的环境经历在Eclipse中同一个样式表的问题:

I experienced the same stylesheet problem within Eclipse using the following environment:


  • Windows 7的64

  • 的Eclipse 3.7.2(SR2)32位

  • JDK 1.6.0_32 32位

  • 蚂蚁1.7.2(在Eclipse)或1.7.4(来自Apache,电流)

  • 的Junit 4.8.1(项目依赖)

我的生成,而使用JDK 1.6.0_31成功,所以才出现了问题样式与Java 6版本32的发布我找不到了Apache的Bugzilla系统中的任何报告介绍了一个Ant或Java错误。如果可以帮助别人,这些都包括在建32 bug修复: http://www.oracle.com/technetwork/java/javase/2col/6u32bugfixes-1579554.html

My build succeeds while using JDK 1.6.0_31, so it appears the stylesheet problem is an Ant or Java bug introduced with the release of Java 6 build 32. I could not find any reports in Apache's Bugzilla system. If it helps someone, these are the bug fixes included in build 32: http://www.oracle.com/technetwork/java/javase/2col/6u32bugfixes-1579554.html

我目前的解决方法是使用Java JDK 6建造31。

My current workaround is to use Java 6 JDK build 31.

更新:解决方案使用较新的JDK

从的 的Eclipse中Ant的失败开始在Java 6u32和Java7u4引入了缺陷。佐贺报道在 Eclipse的错误#3847​​57 ,包括一种变通方法,让您使用较新的JDK。

The Ant failures from within Eclipse started with a defect introduced in Java 6u32 and Java7u4. The saga is reported in Eclipse Bug #384757, including a workaround allowing you to use newer JDKs.


  • 下载 org.apache.xalan org.apache.xml.serializer 从插件< A HREF =htt​​p://download.eclipse.org/tool​​s/orbit/downloads/相对=nofollow>的Eclipse项目轨道

  • 将它们复制到在Java中列出的目录 java.ext.dirs 属性

  • Download the org.apache.xalan and org.apache.xml.serializer plug-ins from the Eclipse Orbit project
  • Copy them to a directory listed in the Java java.ext.dirs property

我用下面的目录,是因为它们是由默认定义,独立于JDK版本:

I use the following directories because they are defined by default and independent of JDK version:


  • 在Windows上: C:\\ WINDOWS \\太阳\\的Java \\ lib目录\\分机

  • 在Mac上: /用户/ $ USER /图书馆/的Java /扩展

  • On Windows: C:\Windows\Sun\Java\lib\ext
  • On Mac: /Users/$USER/Library/Java/Extensions

问题的根源报道甲骨文,但错误不再在他们的bug数据库。我不看好它永远是固定的。

The root problem was reported to Oracle, but the bug is no longer in their bug database. I am not optimistic it will ever be fixed.

更新:在Apache的Ant的解决了这一问题

阿帕奇已经修复问题的根源;它可能会在Ant 1.9.0版本中提供( Apache的错误#54641 )。

Apache has fixed the root problem; it may be available in the Ant 1.9.0 release (Apache Bug #54641).

更新:蚂蚁1.9.1定为Eclipse 4.4

由于@OliBlogger提到的,固定的Apache Ant中1.9.1问题的根源。 Eclipse的计划更新到Ant 1.9.1在Eclipse 4.4 (或许更早,Eclipse的纠错系统还没有版本4.3.x里程碑)。

As @OliBlogger mentioned, Apache fixed the root problem in Ant 1.9.1. Eclipse plans to update to Ant 1.9.1 in Eclipse 4.4 (perhaps sooner, the Eclipse bug system does not yet have 4.3.x milestones).

更新:修正了在Eclipse 4.4

我证实,我现在构建成功使用Java JDK 7 67建立和Ant 1.9.2与Eclipse 4.4.1(Windows 7)中分发,而无需使用轨道插件的解决方法。

I confirmed that my build now succeeds using Java 7 JDK build 67 and Ant 1.9.2 distributed with Eclipse 4.4.1 (Windows 7) without using the Orbit plug-in workaround.

这篇关于在Eclipse中的junit蚂蚁生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆