You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2010/03/14 17:24:56 UTC

DO NOT REPLY [Bug 43586] java.io.FileNotFoundException: /home/***/apache-ant-1.7.0/junitvmwatcher *** .properties

https://issues.apache.org/bugzilla/show_bug.cgi?id=43586

--- Comment #16 from Clark Archer <cl...@gmail.com> 2010-03-14 16:24:49 UTC ---
Created an attachment (id=25126)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25126)
strips null and empty args from command line

I've attached a patch based on comments by Gerry and Steve which prevents this
somewhat cryptic error when running tests in a forked JVM:

    [junit] Exception in thread "main" java.lang.NoClassDefFoundError:
    [junit] Caused by: java.lang.ClassNotFoundException:
    [junit]     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    [junit]     at java.security.AccessController.doPrivileged(Native Method)
    [junit]     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    [junit]     at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    [junit]     at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    [junit] Could not find the main class: .  Program will exit.

The fix is indeed to strip null/empty args.  I considered throwing a
BuildException but figured that might break too many existing builds that have
other option arguments in positions other than the first.

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