JRuby

Error during run-junit task during build

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: JRuby 1.0.0RC3
  • Component/s: Miscellaneous
  • Labels:
    None
  • 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
  • Number of attachments :
    0

Description

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.

Activity

Hide
Tim Barlotta added a comment -

Just did an update from subversion and noticed that I no longer needed to make any changes to successfully build JRuby. Thanks!

Show
Tim Barlotta added a comment - Just did an update from subversion and noticed that I no longer needed to make any changes to successfully build JRuby. Thanks!
Hide
Steen Lehmann added a comment -

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.

Show
Steen Lehmann added a comment - 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.
Hide
Geoffrey Bays added a comment -

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

Show
Geoffrey Bays added a comment - 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
Hide
Kevin Williams added a comment -

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

Show
Kevin Williams added a comment - 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
Hide
Tim Barlotta added a comment -

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.

Show
Tim Barlotta added a comment - 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.
Hide
Tim Barlotta added a comment -

@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

Show
Tim Barlotta added a comment - @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
Hide
Tim Barlotta added a comment -

Please take another look at this issue, it seems that a few people are still experiencing this issue.

Show
Tim Barlotta added a comment - Please take another look at this issue, it seems that a few people are still experiencing this issue.
Hide
Charles Oliver Nutter added a comment -

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.

Show
Charles Oliver Nutter added a comment - 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.
Hide
Charles Oliver Nutter added a comment -

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).

Show
Charles Oliver Nutter added a comment - 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).

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: