Issue Details (XML | Word | Printable)

Key: JRUBY-731
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Charles Oliver Nutter
Reporter: Tim Barlotta
Votes: 0
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
JRuby

Error during run-junit task during build

Created: 28/Mar/07 03:59 PM   Updated: 22/Dec/07 06:29 AM
Component/s: Miscellaneous
Affects Version/s: None
Fix Version/s: JRuby 1.0.0RC3

Time Tracking:
Not Specified

Environment: SVN Version of JRuby, Windows XP, Ant 1.7, Java 6
Repeatable w/ Ant 1.6.5. Also repeatable on Mac OS X with Java 5 and Ant 1.6.5 and Ant 1.7


 Description  « Hide
When attempting to build Jruby from source following the installation instructions the following error occurs:
----------------------------------------------
run-junit:
[junit] Testsuite: org.jruby.test.MainTestSuite
[junit] Exception in thread "main" java.lang.NoSuchMethodError: org.apache.tools.ant.util.FileUtils.close(Ljava/io/Writer;)V
[junit] at org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.endTestSuite(XMLJUnitResultFormatter.java:174)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireEndTestSuite(JUnitTestRunner.java:620)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:453)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:912)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:766)

BUILD FAILED
C:\temp\jruby\build.xml:311: Test org.jruby.test.MainTestSuite failed (crashed)
----------------------------------------------

It appears that the ant.jar in the lib directory is included in the build.classpath of the build.xml file. This ant.jar is version 1.5.

I was able to workaround this problem by doing either of the following:
a) removing ant.jar from the lib directory
b) modifying the build.xml file to exclude the ant.jar file from the build.classpath
<path id="build.classpath">
<fileset dir="${lib.dir}" includes="*.jar" excludes="jruby.jar,ant.jar"/>
</path>

This worked on both Windows XP and Mac OS X.

Perhaps the ant.jar in the lib directory should be removed or updated. Or perhaps the build.xml file should be tweaked as noted.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Tim Barlotta added a comment - 14/Apr/07 01:16 PM
Just did an update from subversion and noticed that I no longer needed to make any changes to successfully build JRuby. Thanks!

Steen Lehmann added a comment - 03/May/07 08:43 AM
I have this problem also, on Mac OS X. The ant.jar in lib is really old. Removing it (or presumably, upgrading to a later version) fixes the issue for me.

Geoffrey Bays added a comment - 18/May/07 10:30 PM
I made the suggested change to build.xml, to exclude the ant.jar and got through most of the tests, but failure occurred much later:
I use win xp, Java 1.6, Ant 1.7, JRuby1.0RC2

run-junit-compiled:
[junit] Testsuite: org.jruby.test.MainTestSuite
[junit] Tests run: 232, Failures: 0, Errors: 0, Time elapsed: 10.835 sec
[junit]
[junit] Testsuite: org.jruby.test.ScriptTestSuite
[junit] FAILED path 20 – ./test\mri\sample\test.rb:1994
[junit] FAILED path 21 – ./test\mri\sample\test.rb:1996
[junit] )
[junit] Tests run: 16, Failures: 1, Errors: 0, Time elapsed: 4.607 sec
[junit]
[junit] Testcase: mri/sample/test.rb(org.jruby.test.ScriptTestSuite$ScriptTe
st): FAILED
[junit] test\mri\sample\test.rb failed, complete failure list follows:
[junit] FAILED path 20 – ./test\mri\sample\test.rb:1994
[junit] FAILED path 21 – ./test\mri\sample\test.rb:1996
[junit]
[junit] junit.framework.AssertionFailedError: test\mri\sample\test.rb failed
, complete failure list follows:
[junit] FAILED path 20 – ./test\mri\sample\test.rb:1994
[junit] FAILED path 21 – ./test\mri\sample\test.rb:1996
[junit]
[junit] at org.jruby.test.ScriptTestSuite$ScriptTest.runTest(ScriptTestS
uite.java:136)
[junit]
[junit]

BUILD FAILED
C:\jruby-1.0.0RC2\build.xml:362: Test org.jruby.test.ScriptTestSuite failed

Total time: 29 seconds
C:\jruby-1.0.0RC2>

Any followup appreciated.

G. Bays


Kevin Williams added a comment - 22/May/07 06:02 PM
I saw the same issue today with RC2 on OS X. I removed ant.jar from /lib and it now builds fine with Ant 1.7

Tim Barlotta added a comment - 24/May/07 07:53 AM
Just to update my experiences, my earlier update was false. I only had the issue not happen one time. Every subsequent update from svn still has the original problem mentioned in the description of this bug.

Tim Barlotta added a comment - 24/May/07 07:58 AM
@Geoffrey Bays: I am getting the same error and (as you have already noticed, but just for others) there is a bug report on this:
http://jira.codehaus.org/browse/JRUBY-947

Tim Barlotta added a comment - 24/May/07 08:00 AM
Please take another look at this issue, it seems that a few people are still experiencing this issue.

Charles Oliver Nutter added a comment - 24/May/07 11:25 AM
It seems we can just delete ant.jar permanently and everything works fine. So maybe that's a good approach for now? I think we're probably going to ditch the serialization stuff anyway, which will make this moot, but in case we don't this seems like a good approach.

Charles Oliver Nutter added a comment - 24/May/07 04:06 PM
We've resolved this in an extremely creative and innovative way: we deleted ant.jar. Yay! There's some additional cleanup needed to remove the taskdef we needed ant.jar for, but it's on the way (we voted that particular taskdef out just today).