You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2006/12/04 16:36:02 UTC

DO NOT REPLY [Bug 41104] New: - FileNotFoundException on forked batched junit tasks

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104

           Summary: FileNotFoundException on forked batched junit tasks
           Product: Ant
           Version: 1.7.0RC1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: osganian@yahoo.com


Using the following task:

        <junit printsummary="on"
               filtertrace="on"
               fork="yes"
               failureProperty="unit.failed"
               haltonfailure="no"
               showoutput="true"
               tempdir="${tmpDir}">
            <classpath refid="unit.classpath"/>
            <syspropertyset refid="unit.propertyset"/>
            <batchtest todir="${testReportDir}">
                <fileset dir="${testSrcDir}">
                    <include name="**/*Test.java"/>
                </fileset>
            </batchtest>
        </junit>

on ANT 1.7RC1 I get the following error:

    [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 3.015 sec
    [junit] java.io.FileNotFoundException:
C:\trunk\build\tmp\junitvmwatcher323850216.properties (The system cannot find
the file specified)

    [junit]     at java.io.FileInputStream.open(Native Method)
    [junit]     at java.io.FileInputStream.<init>(FileInputStream.java:106)
    [junit]     at java.io.FileReader.<init>(FileReader.java:55)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeAsForked(JUnitTask.java:1025)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:817)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1627)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:764)
    [junit]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    [junit]     at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
    [junit]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [junit]     at java.lang.reflect.Method.invoke(Method.java:585)
    [junit]     at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    [junit]     at org.apache.tools.ant.Task.perform(Task.java:342)
    [junit]     at org.apache.tools.ant.Target.execute(Target.java:357)
    [junit]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
    [junit]     at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1292)
    [junit]     at org.apache.tools.ant.Project.executeTarget(Project.java:1261)

    [junit]     at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    [junit]     at org.apache.tools.ant.Project.executeTargets(Project.java:1144)
    [junit]     at org.apache.tools.ant.Main.runBuild(Main.java:698)
    [junit]     at org.apache.tools.ant.Main.startAnt(Main.java:199)
    [junit]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
    [junit]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
    [junit] Running MyTest

I see the file junitvmwatcher323850216.properties get created and then removed
in my tmpDir but I supposed there is a synchronization issue going on.

The tasks runs fine in ANT 1.6.5 or if I set fork="no" but if I do that only so
many of my tasks run then it eventually fails.

I'm using junit 4.1 (which i dropped in the ANT's lib dir).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41104] - FileNotFoundException on forked batched junit tasks

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104





------- Additional Comments From osganian@yahoo.com  2006-12-04 09:43 -------
1. Each test that runs gets the same error, just the generated property file
name is unique.
2. No test delete the ${tmpDir}, ${tmpDir} is created before the <junit> task.
3. If I don't specify ${tmpDir} as the <junit>'s tempdir I still get the problem.

I can try and generate a zip to reproduce the problem.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41104] - FileNotFoundException on forked batched junit tasks

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104





------- Additional Comments From peterreilly@apache.org  2006-12-06 16:24 -------
I have done some more testing with this.
If the classpath given to junit contains
ant.1.6 classes, one gets the FileNotFoundException.
and after this there should be a "Tests FAILED (crashed)"
- can you confirm that.

As regards the "false positive" summary report:
[junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 3.015 sec

I recompiled ant 1.6.5 and changed the summary output string to
reflect the version, I found that that this output comes from
the ant 1.6.5 summary report.

task:
    <junit printsummary="yes" fork="yes" forkmode="once">
      <classpath>
        <path path="build/classes"/>
        <fileset dir="lib" includes="*.jar"/>
        <fileset dir="l:/src/apache-ant-1.6.5/dist/lib" includes="*.jar"/>
      </classpath>
      <batchtest todir="build/reports">
        <fileset dir="src"/>  <!-- contains two test classes each of which have
                                   two tests -->
      </batchtest>
      <formatter type="xml"/>
    </junit>

I get the following output (after removing the spurious filenotfound exception):

Tests run: 2, Failures(1.6): 0, Errors: 0, Time elapsed: 0.328 sec
Tests run: 2, Failures(1.6): 0, Errors: 0, Time elapsed: 0.016 sec
Running Example
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
Tests FAILED (crashed)

BUILD SUCCESSFUL

So it looks like the tests ran successfully,
the SummaryReport from ant 1.6 got used to report the success,
this is hidden from ant 1.7, which sees that the
junitrunner task seems to have crashed (1.7 has a new
handshake mechanism based on the error return and the
crash file) it reports this via the 1.7 summary report,
and then reports a crash.

Of course mixing ant1.6 and ant1.7 jars in the classpath
will not be good, the question is how can ant detect
this and report this to the user.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41104] - FileNotFoundException on forked batched junit tasks

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104





------- Additional Comments From osganian@yahoo.com  2006-12-04 12:23 -------
Just to be clear, I set the <include name=""/> within the <batchtest> block to a
single test and it still fails with the same error.

Also I'm using weblogic 9.2 as my j2ee server and get all my J2EE jar libraries
from it for my classpath (using api.jar and weblogic.jar).


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41104] - FileNotFoundException on forked batched junit tasks

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104





------- Additional Comments From peterreilly@apache.org  2006-12-04 09:34 -------
This is interesting.
1) are all the tests run (i.e. are there only three tests?)
2) do any of the tests delete the ${tmpDir}?
3) do you get the problem if the "tempdir" attribute is not used.

If possible, can you reduce your project to
the smallest that causes the problem (i.e. one test),
and if possible place it in a zip file and
attach them to this bug report.
Tx.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41104] - FileNotFoundException on forked batched junit tasks

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104





------- Additional Comments From peterreilly@apache.org  2006-12-04 12:59 -------
There is a problem if the JUnitTestRunner cannot
be created. In this case nothing would create
the vmlancher file that JunitTest tries to
delete.
This can happen if the classpath used for JUnitTestRunner
contains weblogic.jar.
A lot of versions of weblogic.jar contain org.apache.tools.ant.*
classes. These can conflict with the classes in ant.

Try to extract the org.apache.tools.ant.* classes from weblogic.jar.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41104] - FileNotFoundException on forked batched junit tasks

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104


peterreilly@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.7.1




------- Additional Comments From peterreilly@apache.org  2006-12-29 09:00 -------
I have added a check to see if there are multi
versions of ant in the classpath for the forked
junit task. - this and Martijn's modification should
solve this bug.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41104] - FileNotFoundException on forked batched junit tasks

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104





------- Additional Comments From osganian@yahoo.com  2006-12-04 13:21 -------
Also, when my explorer window is looking at my ${tmpDir} directory I can see the
junitvmwatcher*.properties file getting created then immediately deleted.  So it
looks like the file is being created just maybe it is just after something else
tries to read it.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41104] - FileNotFoundException on forked batched junit tasks

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104


peterreilly@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chwells@us.ibm.com




------- Additional Comments From peterreilly@apache.org  2007-01-31 11:44 -------
*** Bug 41511 has been marked as a duplicate of this bug. ***

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41104] - FileNotFoundException on forked batched junit tasks

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104





------- Additional Comments From jkf@apache.org  2006-12-22 13:21 -------
I have added a check on existing file in the JUnitTask which gives a somewhat
better error in the report. (I knew of the discussion, not of this actual
report). Does this resolve this issue?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41104] - FileNotFoundException on forked batched junit tasks

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104





------- Additional Comments From osganian@yahoo.com  2006-12-04 13:07 -------
Thanks for the quick reply.

I checked weblogic.jar in version 9.2 and there isn't that package.  There is a
antlr package however, is that equalivent?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41104] - FileNotFoundException on forked batched junit tasks

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104


antoine@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.7.0RC1                    |1.7.0




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 41104] - FileNotFoundException on forked batched junit tasks

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41104





------- Additional Comments From osganian@yahoo.com  2006-12-04 14:50 -------
Ok, I messed up, I still had a weblogic.jar in the classpath.  You are right if
I take (all) weblogic.jar files out of the classpath it works.  Not sure what is
in there but it turns out I didn't need weblogic.jar in my classpath for
compiling/unit tests anyway.

Sorry if I wasted your time.  Not sure if there is still a bug there or not.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org