Return-Path: Delivered-To: apmail-incubator-uima-user-archive@locus.apache.org Received: (qmail 24594 invoked from network); 29 Oct 2008 08:14:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Oct 2008 08:14:23 -0000 Received: (qmail 40671 invoked by uid 500); 29 Oct 2008 08:14:28 -0000 Delivered-To: apmail-incubator-uima-user-archive@incubator.apache.org Received: (qmail 40640 invoked by uid 500); 29 Oct 2008 08:14:28 -0000 Mailing-List: contact uima-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: uima-user@incubator.apache.org Delivered-To: mailing list uima-user@incubator.apache.org Received: (qmail 40629 invoked by uid 99); 29 Oct 2008 08:14:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Oct 2008 01:14:28 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [85.214.115.60] (HELO h1349259.stratoserver.net) (85.214.115.60) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Oct 2008 08:13:12 +0000 Received: from 1.121.113.82.net.de.o2.com ([82.113.121.1] helo=MotokoKusanagi.isabel-drost.de) by h1349259.stratoserver.net with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Kv68S-0005DR-CD for uima-user@incubator.apache.org; Wed, 29 Oct 2008 08:10:39 +0000 From: Isabel Drost Organization: Apache To: uima-user@incubator.apache.org Subject: Unit testing CollectionReaders Date: Wed, 29 Oct 2008 09:10:07 +0100 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1464623.7gkDTQ8ikv"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200810290910.13578.isabel@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org --nextPart1464623.7gkDTQ8ikv Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, I am about to do my first steps using UIMA. I started out with the tutorial= =20 and am about to write my first CollectionReader (extending=20 CollectionReader_ImplBase). As the tutorial says, I implemented initialize(= )=20 to init the reader from its config parameters: > ... > File webKbDir =3D new File((String) getConfigParameterValue(PARAM_INPUTDI= R)); > ... In order to test the class I created a unit test. I thought it might be a g= ood=20 idea to set the parameters of the reader in the setUp method of my test lik= e=20 this: > ... > public void setUp() throws Exception { > this.reader =3D new WebKbReader(); > URL path =3D this.getClass().getResource("dataset"); > String pathString =3D path.getPath(); > this.reader.setConfigParameterValue(WebKbReader.PARAM_INPUTDIR, path); > this.reader.initialize(); > } =2E.. Unfortunately this gives me a null pointer exception in the line setting th= e=20 config parameter that comes from inside UIMA: > java.lang.NullPointerException > at=20 org.apache.uima.resource.ConfigurableResource_ImplBase.getConfigParameterVa= lue(ConfigurableResource_ImplBase.java:37) > at=20 org.apache.mahout.clustering.webkb.kmeans.WebKbReader.initialize(WebKbReade= r.java:58) I had a look at the UIMA code, the line throwing the exception is the=20 following: > public void setConfigParameterValue(String aParamName, Object aValue) { > getUimaContextAdmin().getConfigurationManager().setConfigParameterValue( > getUimaContextAdmin().getQualifiedContextName() + aParamName, aValue= ); > } I guess I am just making some stupid beginners mistake - forgot to initiali= ze=20 some internal UIMA object before calling my reader? Unfortunately I have no= =20 clue what could have gone wrong. Any help would be appreciated. Thanks, Isabel =2D-=20 A woman should have compassion. -- Kirk, "Catspaw", stardate 3018.2 |\ _,,,---,,_ Web: /,`.-'`' -. ;-;;,_ |,4- ) )-,_..;\ ( `'-' '---''(_/--' `-'\_) (fL) IM: --nextPart1464623.7gkDTQ8ikv Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkkIGmAACgkQPJpCBAwIhbSVWACghy6hhHxFeKBIfkFnQRHOAwd9 iqkAn2tQrZwv8Tfoi0moJW3pjIUNp2Hi =Fq3o -----END PGP SIGNATURE----- --nextPart1464623.7gkDTQ8ikv--