Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 58449 invoked from network); 4 Dec 2008 12:52:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Dec 2008 12:52:46 -0000 Received: (qmail 79077 invoked by uid 500); 4 Dec 2008 12:52:54 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 78982 invoked by uid 500); 4 Dec 2008 12:52:54 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 78971 invoked by uid 99); 4 Dec 2008 12:52:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 04:52:54 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [193.109.238.66] (HELO dnsinet.rzf-nrw.de) (193.109.238.66) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 12:51:24 +0000 Received: from z011100.bk.fin.local (z011100.bk.fin.local [172.18.101.140]) by dnsinet.rzf-nrw.de (8.14.0/8.14.0) with ESMTP id mB4CqADc025322 for ; Thu, 4 Dec 2008 13:52:10 +0100 Received: from z011101.bk.fin.local ([130.11.7.101]) by z011100.bk.fin.local with Microsoft SMTPSVC(6.0.3790.1830); Thu, 4 Dec 2008 13:52:10 +0100 Received: from z011021.bk.fin.local ([130.11.7.21]) by z011101.bk.fin.local with Microsoft SMTPSVC(6.0.3790.1830); Thu, 4 Dec 2008 13:52:10 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: AW: question about clearcase api Date: Thu, 4 Dec 2008 13:52:10 +0100 Message-ID: <9EE86F1965E19E499C80DE52AC807B5502A47756@z011021.bk.fin.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: question about clearcase api Thread-Index: AclViVttDz8NlZGcQ1KHznL5vsC/IQAg3RxQAABtguA= References: <92D277D85AF60343A65790EFEE7618E61E0ACEA4@emss04m12.us.lmco.com> From: To: X-OriginalArrivalTime: 04 Dec 2008 12:52:10.0787 (UTC) FILETIME=[1F634F30:01C9560F] X-Virus-Checked: Checked by ClamAV on apache.org >I am trying to use the clearcase >org.apache.tools.ant.taskdefs.optional.clearcase.CCCheckout tool and I >get a null pointer error on line 43 "ckout.execute();". The code is >attached below. > >=20 > >Here is the Exception: > >=20 > >Exception in thread "main" java.lang.NullPointerException > > at >org.apache.tools.ant.taskdefs.optional.clearcase.ClearCase.run( >ClearCase >.java:134) > > at >org.apache.tools.ant.taskdefs.optional.clearcase.CCCheckout.exe >cute(CCCh >eckout.java:145) > > at >com.lmco.dat.util.ClearCaseMethods.checkOutFiles(ClearCaseMetho >ds.java:4 >4) > > at com.lmco.dat.util.Main.main(Main.java:9) > >=20 > >I checked and all of the required attributes are set( > >reserved > >Specifies whether to check out the file as reserved or not > >Yes > >). =20 > >=20 > >Do you have a code example that I can view? > >=20 > >Thanks in advance, > >Nicole > >=20 > >1 package com.lmco.dat.util; > >2 > >3 import java.io.File; > >4 import java.text.SimpleDateFormat; > >5 > >6 import org.apache.tools.ant.Task; > >7 import >org.apache.tools.ant.taskdefs.optional.clearcase.CCCheckout; > >8 =20 > >9 public class ClearCaseMethods{ > >10 =20 > >11 /** Date format required by commands passed to Clear Case */ > >12 static final SimpleDateFormat IN_DATE_FORMAT =3D > >13 new >SimpleDateFormat("dd-MMMM-yyyy.HH:mm:ss"); > >14 > >15 /** Date format returned in the output of Clear Case=20 >commands. */ > >16 static final SimpleDateFormat OUT_DATE_FORMAT =3D=20 > >17 new >SimpleDateFormat("yyyyMMdd.HHmmss"); > >18 =20 > >19 /** The path of the clear case view */ > >20 private static String viewPath =3D >"C:/ngrant_irad_view/webapps/IRADMgmt/test.txt"; > >21 private String branch; > >22 > >23 =20 > >24 //Constructor > >25 public static void ClearCaseMethods(){ > >26 System.out.println("Here is my Clearcase test"); > >27 } > >28 =20 > >29 =20 > >30 public static void checkOutFiles(){ > >31 =20 > >32 Boolean reserved =3D true; > >33 =20 > >34 CCCheckout ckout =3D new CCCheckout(); > >35 ckout.setBranch("main"); > >36 ckout.setDescription("test desc"); > >37 ckout.setViewPath("C:/ngrant_irad_view"); =20 > >38 ckout.setComment("here is my comment"); > >39 ckout.setReserved(reserved); > >40 ckout.setOut("C:/ngrant_irad_view/webapps/IRADMgmt/"); > >41 ckout.setObjSelect("test.txt"); > >42 =20 > >43 ckout.execute(); > >44=20 > You could have a look at its source http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/an t/taskdefs/optional/clearcase/ClearCase.java?view=3Dannotate Line 134 is exe.setWorkingDirectory(aProj.getBaseDir()); aProj is initialized on 130 Project aProj =3D getProject(); That method is inherited from ProjectComponent (Task base class extends that) which returns the project reference needed for logging, properties etc. You havent set that value. ckout.setProject(...); Jan --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org