Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 46812 invoked from network); 27 Aug 2004 08:53:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 27 Aug 2004 08:53:14 -0000 Received: (qmail 62890 invoked by uid 500); 27 Aug 2004 08:53:03 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 62852 invoked by uid 500); 27 Aug 2004 08:53:03 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 62838 invoked by uid 99); 27 Aug 2004 08:53:03 -0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=RCVD_IN_RFC_IPWHOIS X-Spam-Check-By: apache.org Received: from [195.101.39.227] (HELO GWOUT.thalesgroup.com) (195.101.39.227) by apache.org (qpsmtpd/0.27.1) with ESMTP; Fri, 27 Aug 2004 01:53:00 -0700 Received: from thalescan.corp.thales (200.3.2.3) by GWOUT.thalesgroup.com (NPlex 6.5.026) id 41281415001CB4BF for user@ant.apache.org; Fri, 27 Aug 2004 10:53:58 +0200 Received: from lowplex.mut.thales ([10.33.19.4]) by thalescan with InterScan Messaging Security Suite; Fri, 27 Aug 2004 10:52:53 +0200 Received: from tisplex.tisfr.thales (142.1.6.1) by lowplex.mut.thales (NPlex 6.5.026) id 412813AB0011C81B for user@ant.apache.org; Fri, 27 Aug 2004 10:52:53 +0200 Received: from tisplex.tisfr.thales (142.1.6.1) by tisplex.tisfr.thales (NPlex 6.5.026) id 41280CFC00110BD6 for user@ant.apache.org; Fri, 27 Aug 2004 10:52:53 +0200 Received: from tismlkplex.tisfr.thales ([142.58.3.100]) by tisplex with InterScan Messaging Security Suite; Fri, 27 Aug 2004 10:52:53 +0200 Received: from tismlkplex.tisfr.thales (142.58.3.100) by tismlkplex.tisfr.thales (NPlex 6.5.026) id 4128140E0006F60D for user@ant.apache.org; Fri, 27 Aug 2004 10:52:53 +0200 Received: from p-103393.mkf.syseca ([142.1.146.103]) by tismlkplex with InterScan Messaging Security Suite; Fri, 27 Aug 2004 10:52:52 +0200 Date: Fri, 27 Aug 2004 10:56:09 +0200 To: "Ant Users List" Subject: Re: calling ant from java program References: <013401c48c06$4c27ddb0$ba015b0a@ionlifesci19> From: "Olivier Croisier" Organization: Thales Information Systems Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: <013401c48c06$4c27ddb0$ba015b0a@ionlifesci19> User-Agent: Opera M2/7.50 (Win32, build 3778) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > What may be the reason of project.executetarget throwing nullpointer > exception? > regds Hi My first idea was that this exception could get thrown if you call the executeTarget method with a null argument, but this error seems to be already managed by the BuildException (@see ant javadoc). [ executeTarget ] public void executeTarget(java.lang.String targetName) throws BuildException Executes the specified target and any targets it depends on. Parameters: targetName - The name of the target to execute. Must not be null. Throws: BuildException - if the build failed So... Another answer would be : your "NullPointerException" occurs if your Project object is null (java obviously can't call the "executeTarget" method on a null Project object). Check if your Project is initialized. Third clue : the "test_config" string you give as an argument is a valid String, but its contents may cause an error somewhere in the executeTarget process, for example if this isn't a valid target name. Or if the target is only defined as an internal target (no "description" for it) : I don't know if executeTarget sees them. best regs -- CROISIER Olivier Software Engineer Thales IS - ANS olivier.croisier@thales-is.com --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org