Return-Path: Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 57764 invoked from network); 27 Jan 2001 02:11:56 -0000 Received: from unknown (HELO geeba.net) (63.170.231.16) by h31.sny.collab.net with SMTP; 27 Jan 2001 02:11:56 -0000 Received: from cumin (cumin.rosetta.zon [172.16.16.106]) by geeba.net (8.9.2/8.9.2) with SMTP id SAA51276 for ; Fri, 26 Jan 2001 18:12:04 -0800 (PST) (envelope-from kelly@ad1440.net) Message-ID: <0ab201c08806$8afea760$6a1010ac@rosetta.zon> From: "Sean Kelly" To: Subject: ExecuteJava creates incorrect AntClassLoader Date: Fri, 26 Jan 2001 18:12:04 -0800 Organization: Independent Consultant MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N I'm seeing a problem with execution. Here's the deal: I'm trying to run a Java program called BuildDependency, a thing from Dallas Semiconductor that acts as a linker/converter for Java programs before they can be run on a TINI, a Java virtual machine on a SIMM. BuildDependency takes a list of .class and .jar files, loads them with its own class loader, operates on their constant pools, checkes references, and otherwise converts the whole thing into a file you can transfer to a TINI and run. BuildDependency comes in a file called tini.jar, filled with various other TINI utilities. When I run BuildDependency from Ant via , and tini.jar isn't in my CLASSPATH, and I use the classpath attribute to point to tini.jar, it works. If I remove the classpath attribute and put tini.jar in my CLASSPATH, it works. But if I have the classpath attribute *and* tini.jar in my CLASSPATH, it doesn't work, failing with: /home/saffron/kelly/junk/therm/build.xml:45: java.lang.IllegalAccessError: try to access class WatchDog from class BuildDependency java.lang.IllegalAccessError: try to access class WatchDog from class BuildDependency at BuildDependency.replaceVariables(BuildDependency.java) at BuildDependency.getDependencies(BuildDependency.java) at BuildDependency.main(BuildDependency.java) at java.lang.reflect.Method.invoke(Native Method) at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:107) at org.apache.tools.ant.taskdefs.Java.run(Java.java:245) at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:122) at org.apache.tools.ant.taskdefs.Java.execute(Java.java:86) ... Now, if I modify the way ExecuteJava gets the AntClassLoader, I can get it to work, by changing: AntClassLoader loader = new AntClassLoader(project, classpath); to: AntClassLoader loader = new AntClassLoader(project, classpath, /*systemFirst*/false); Question is, why isn't this the case in the Ant source? If the user's specified a classpath attribute in his task, should that be used preferentially (systemFirst=false) to the system CLASSPATH? --k