Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 6120 invoked from network); 16 Sep 2009 21:46:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Sep 2009 21:46:29 -0000 Received: (qmail 2894 invoked by uid 500); 16 Sep 2009 21:46:28 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 2870 invoked by uid 500); 16 Sep 2009 21:46:28 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 2861 invoked by uid 99); 16 Sep 2009 21:46:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2009 21:46:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2009 21:46:25 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id 2D84C234C1E9; Wed, 16 Sep 2009 14:46:03 -0700 (PDT) From: bugzilla@apache.org To: notifications@ant.apache.org Subject: DO NOT REPLY [Bug 47854] New: Ant can't run within another Java program X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ant X-Bugzilla-Component: Core X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: bugzilla@byrden.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: notifications@ant.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 16 Sep 2009 14:46:03 -0700 (PDT) X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=47854 Summary: Ant can't run within another Java program Product: Ant Version: 1.7.1 Platform: PC OS/Version: Windows XP Status: NEW Severity: enhancement Priority: P2 Component: Core AssignedTo: notifications@ant.apache.org ReportedBy: bugzilla@byrden.com My current shell is XMLSH, a Java program that loads Ant into its own VM. But I had to modify 2 classes to make this work. Ant 1.7.1 is an ill-behaved guest in the VM Because: [1] It calls System.exit() which kills the entire VM. [2] It makes an unwarranted assumption about its ClassLoaders Re [1] : there are calls to System.exit() in both the Launcher class and the Main class. I can extend Main to change this, but not Launcher. In my opinion (I have Java programmer certification) no Java program should need to kill the VM unless something is wrong. Re [2] : on loading Ant, I see this: "org.apache.tools.ant.Main cannot be cast to org.apache.tools.ant.launch.AntMain" Reason: the Launcher class makes 2 ClassLoaders and assumes they will connect up in a parent-child relationship. For me, they don't. I can see no reason why Launcher should not make that connection explicitly. Note: after changing these 2 classes, I am able to run Ant under XMLSH with a very simple wrapper script. David -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.