Return-Path: X-Original-To: apmail-uima-user-archive@www.apache.org Delivered-To: apmail-uima-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5A36911C3D for ; Mon, 4 Aug 2014 12:13:17 +0000 (UTC) Received: (qmail 63193 invoked by uid 500); 4 Aug 2014 12:13:17 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 63151 invoked by uid 500); 4 Aug 2014 12:13:17 -0000 Mailing-List: contact user-help@uima.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@uima.apache.org Delivered-To: mailing list user@uima.apache.org Received: (qmail 63130 invoked by uid 99); 4 Aug 2014 12:13:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2014 12:13:15 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ewal@pointpro.nl designates 91.192.36.142 as permitted sender) Received: from [91.192.36.142] (HELO obelix.pointpro.nl) (91.192.36.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2014 12:13:10 +0000 Received: from localhost (localhost [127.0.0.1]) by obelix.pointpro.nl (Postfix) with ESMTP id 733FC800AED for ; Mon, 4 Aug 2014 14:12:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=pointpro.nl; h= content-transfer-encoding:content-type:content-type:mime-version :references:in-reply-to:user-agent:message-id:date:date:subject :subject:from:from:received:received; s=main; t=1407154364; x= 1408968764; bh=1dhRuX7gNu/Y28tMDu1pvooLcnSoW+iCJRcZDh0Glfs=; b=E i148XfPyk5MXtGMeBqZiDqr+sSM9tINuooslM2+yQBMV33PVybeMS+HQAHbDoaHu Sw/wjj+svXpA93M4QsUSq6yhf4ojksYM/s5fOREgIXF6GyGid4brVUkTvf9QwiIq JKgSu2hwKIBHHC8IPZB8JwSfisBYbSc0GXwJ68IRFk= X-Virus-Scanned: Debian amavisd-new at pointpro.nl Received: from obelix.pointpro.nl ([127.0.0.1]) by localhost (obelix.pointpro.nl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 6e4xzCe+dVHV for ; Mon, 4 Aug 2014 14:12:44 +0200 (CEST) Received: from idefix.localnet (5ED43CD0.cm-7-5a.dynamic.ziggo.nl [94.212.60.208]) (Authenticated sender: ewal@pointpro.nl) by obelix.pointpro.nl (Postfix) with ESMTPSA id 22BC1800ADC for ; Mon, 4 Aug 2014 14:12:44 +0200 (CEST) From: Egbert van der Wal To: user@uima.apache.org Subject: Re: UIMA AS NullPointerException in CasDefinition constructor Date: Mon, 04 Aug 2014 14:07:18 +0200 Message-ID: <9787583.tKuez2hzAe@idefix> User-Agent: KMail/4.13.2 (Linux/3.13.0-32-generic; KDE/4.13.2; x86_64; ; ) In-Reply-To: References: <1506577.nrMATQckqp@idefix> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart4659752.NmO7JeWGnq" Content-Transfer-Encoding: 7Bit X-Virus-Checked: Checked by ClamAV on apache.org --nextPart4659752.NmO7JeWGnq Content-Type: multipart/alternative; boundary="nextPart13677369.uOYgdvJG0g" Content-Transfer-Encoding: 7Bit This is a multi-part message in MIME format. --nextPart13677369.uOYgdvJG0g Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Hi Eddie, Thanks for the suggestion. I have limited time to work on this so my response may be slow now and again, but I'm still working on it. Your input is very much appreciated! First of all, the command: runRemoteAsyncAE.sh/cmd tcp://localhost:61616 MeetingDetectorTaeQueue \ -d Deploy_MeetingDetectorTAE.xml \ -c $UIMA_HOME/examples/descriptors/collection_reader/FileSystemCollectionR eader.xml completes without any errors, so the example seems to be running fine. I've been fiddling around with it and I was able to pinpoint the problem to the collection reader. I have a collection reader (subclassed from CollectionReader_ImplBase) that is added to the AsynchronousEngine. However, it does not seem to be the specific implementation. I've reduced all code / annotators etc to a very basic set that still shows the problem, where the AE only has one (very basic) annotator and the Collection Reader actually doesn't do anything except stating that there's nothing left to do. I'll attach the Minimum Working Examples (or actually, not-working examples) that I've constructed to pinpoint the problem. Commenting out line 62 (the call to setCollectionReader) 'fixes' the problem. However, as you can see, the implementation of MWEReader doesn't do anything at all, so I don't really see why it would cause this trouble. Any ideas on what is causing this problem? Thanks, Egbert On Monday, July 28, 2014 05:14:39 PM Eddie Epstein wrote: > Hi Egbert, > > The README file for UIMA-AS shows an application example with > Deploy_MeetingDetectorTAE.xml.Does that run OK for you? > > Assuming yes, can you give more details about the scenario, perhaps the > explicit commands used? The descriptors used? > > Eddie > > > > On Mon, Jul 28, 2014 at 11:46 AM, Egbert van der Wal > > wrote: > > Hi, > > > > I'm trying to convert an existing and functional UIMA pipeline to a UIMA > > AS pipeline. > > > > > > > > I'm getting there, I created deployment descriptors for the annotators and > > when running my application all individual annotators are launched > > correctly. The composite analysis engine also loads fine but I'm getting a > > NullPointerException when calling initialize(deployCtx) on the > > UimaAsEngine > > on line 66. See the attached text document for the full exception. > > > > > > > > > > > > I found a similar issue in the bug tracker which was fixed in UIMA AS 2.3: > > > > > > > > https://issues.apache.org/jira/browse/UIMA-1376 > > > > > > > > But this seems to arise in mergeTypeSystem and this does not seem to be > > the case in my situation. The line number is the same however. > > > > > > > > Any clues on where I should look for the solution? Are my descriptors > > faulty? Is the Java code faulty? Or is this a bug in UIMA AS 2.4.0? How > > can > > I debug this issue? > > > > > > > > Thanks, > > > > > > > > Egbert --nextPart13677369.uOYgdvJG0g Content-Transfer-Encoding: 7Bit Content-Type: text/html; charset="utf-8"

Hi Eddie,

 

Thanks for the suggestion. I have limited time to work on this so my response may be slow now and again, but I'm still working on it. Your input is very much appreciated!

 

First of all, the command:

 

runRemoteAsyncAE.sh/cmd tcp://localhost:61616 MeetingDetectorTaeQueue \

-d Deploy_MeetingDetectorTAE.xml \

-c $UIMA_HOME/examples/descriptors/collection_reader/FileSystemCollectionReader.xml

 

completes without any errors, so the example seems to be running fine.

 

I've been fiddling around with it and I was able to pinpoint the problem to the collection reader. I have a collection reader (subclassed from CollectionReader_ImplBase) that is added to the AsynchronousEngine. However, it does not seem to be the specific implementation.

 

I've reduced all code / annotators etc to a very basic set that still shows the problem, where the AE only has one (very basic) annotator and the Collection Reader actually doesn't do anything except stating that there's nothing left to do.

 

I'll attach the Minimum Working Examples (or actually, not-working examples) that I've constructed to pinpoint the problem.

 

Commenting out line 62 (the call to setCollectionReader) 'fixes' the problem. However, as you can see, the implementation of MWEReader doesn't do anything at all, so I don't really see why it would cause this trouble.

 

Any ideas on what is causing this problem?

 

Thanks,

 

Egbert

 

 

On Monday, July 28, 2014 05:14:39 PM Eddie Epstein wrote:

> Hi Egbert,

>

> The README file for UIMA-AS shows an application example with

> Deploy_MeetingDetectorTAE.xml.Does that run OK for you?

>

> Assuming yes, can you give more details about the scenario, perhaps the

> explicit commands used? The descriptors used?

>

> Eddie

>

>

>

> On Mon, Jul 28, 2014 at 11:46 AM, Egbert van der Wal <ewal@pointpro.nl>

>

> wrote:

> > Hi,

> >

> > I'm trying to convert an existing and functional UIMA pipeline to a UIMA

> > AS pipeline.

> >

> >

> >

> > I'm getting there, I created deployment descriptors for the annotators and

> > when running my application all individual annotators are launched

> > correctly. The composite analysis engine also loads fine but I'm getting a

> > NullPointerException when calling initialize(deployCtx) on the

> > UimaAsEngine

> > on line 66. See the attached text document for the full exception.

> >

> >

> >

> >

> >

> > I found a similar issue in the bug tracker which was fixed in UIMA AS 2.3:

> >

> >

> >

> > https://issues.apache.org/jira/browse/UIMA-1376

> >

> >

> >

> > But this seems to arise in mergeTypeSystem and this does not seem to be

> > the case in my situation. The line number is the same however.

> >

> >

> >

> > Any clues on where I should look for the solution? Are my descriptors

> > faulty? Is the Java code faulty? Or is this a bug in UIMA AS 2.4.0? How

> > can

> > I debug this issue?

> >

> >

> >

> > Thanks,

> >

> >

> >

> > Egbert

 

--nextPart13677369.uOYgdvJG0g-- --nextPart4659752.NmO7JeWGnq Content-Disposition: attachment; filename="MWE.java" Content-Transfer-Encoding: 7Bit Content-Type: text/x-java; charset="UTF-8"; name="MWE.java" package nl.novay.keywordSpotter; import java.io.File; import java.util.HashMap; import java.util.Map; import org.apache.uima.aae.client.UimaAsynchronousEngine; import org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl; public class MWE { public static void main(String [] args) { MWE engine = new MWE(); try { engine.initializeEngine(); } catch (Exception e) {} } private UimaAsynchronousEngine ae; private MWEReader reader; protected void initializeEngine() throws Exception { reader = new MWEReader(); // preparing map for use in deploying services Map deployCtx = new HashMap(); deployCtx.put(UimaAsynchronousEngine.DD2SpringXsltFilePath, System.getenv("UIMA_HOME") + "/bin/dd2spring.xsl"); deployCtx.put(UimaAsynchronousEngine.SaxonClasspath, "file:" + System.getenv("UIMA_HOME") + "/saxon/saxon8.jar"); // Set up paths String base_path = "./"; String deploy_path = base_path + "desc/deployment/"; String ae_path = base_path + "desc/analysis_engines/Deploy"; String engine = "MWEEngine.xml"; // Initialize the UIMA AS Engine ae = new BaseUIMAAsynchronousEngine_impl(); System.setProperty("defaultBrokerURL", "tcp://localhost:61616"); // Iterate over all to-be-deployed annotators String filenames [] = { "DeployRegExp.xml" }; for (String filename : filenames) { File file = new File(deploy_path + filename); System.out.println("Deploying UIMA AS Annotator: " + file.getName()); ae.deploy(file.getAbsolutePath(), deployCtx); System.out.println("Deployed UIMA AS Annotator: " + file.getName() + "\n\n\n\n"); } System.out.println("Deploying UIMA AS Annotation Engine: " + engine); ae.deploy(ae_path + engine, deployCtx); System.out.println("Attaching collection reader to AS Engine: " + reader); ae.setCollectionReader(reader); System.out.println("Initializing AS Engine"); deployCtx.put(UimaAsynchronousEngine.ServerUri, "tcp://localhost:61616"); deployCtx.put(UimaAsynchronousEngine.Endpoint, "MWEQueue"); deployCtx.put(UimaAsynchronousEngine.CasPoolSize, 2); ae.initialize(deployCtx); } } --nextPart4659752.NmO7JeWGnq Content-Disposition: attachment; filename="MWEReader.java" Content-Transfer-Encoding: 7Bit Content-Type: text/x-java; charset="UTF-8"; name="MWEReader.java" package nl.novay.keywordSpotter; import java.io.IOException; import org.apache.uima.cas.CAS; import org.apache.uima.collection.CollectionException; import org.apache.uima.collection.CollectionReader_ImplBase; import org.apache.uima.util.Progress; import org.apache.uima.util.ProgressImpl; public class MWEReader extends CollectionReader_ImplBase { @Override public void initialize() {} @Override public boolean hasNext() { return false; } @Override public void getNext(CAS cas) throws IOException, CollectionException { if (true) throw new CollectionException(new Exception("Not implemented")); } @Override public Progress[] getProgress() { return new Progress[]{new ProgressImpl(0, 0, Progress.ENTITIES)}; } @Override public void close() throws IOException {} } --nextPart4659752.NmO7JeWGnq Content-Disposition: attachment; filename="DeployMWEEngine.xml" Content-Transfer-Encoding: 7Bit Content-Type: application/xml; name="DeployMWEEngine.xml" deploymentDescriptor 1.0 --nextPart4659752.NmO7JeWGnq Content-Disposition: attachment; filename="MWEEngine.xml" Content-Transfer-Encoding: 7Bit Content-Type: application/xml; name="MWEEngine.xml" org.apache.uima.java false Minimum Working Example 1.0 Novay RegExpTokenizer org.apache.uima.TokenAnnotation true true false --nextPart4659752.NmO7JeWGnq Content-Disposition: attachment; filename="DeployRegExp.xml" Content-Transfer-Encoding: 7Bit Content-Type: application/xml; name="DeployRegExp.xml" DeployRegExp 1.0 --nextPart4659752.NmO7JeWGnq Content-Disposition: attachment; filename="RegExpTokenizer.xml" Content-Transfer-Encoding: 7Bit Content-Type: application/xml; name="RegExpTokenizer.xml" org.apache.uima.java true nl.novay.uima.annotator.Tokenizer RegExpTokenizer 1.0 regExpFile String false false regExpFile regexp/expressions.txt org.apache.uima.annotation.TokenAnnotation true true false --nextPart4659752.NmO7JeWGnq--