ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 47854] New: Ant can't run within another Java program
Date Wed, 16 Sep 2009 21:46:03 GMT

           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

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:
" cannot be cast to"

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.


Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message