Return-Path: Delivered-To: apmail-incubator-uima-user-archive@minotaur.apache.org Received: (qmail 88980 invoked from network); 3 Feb 2010 12:00:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Feb 2010 12:00:37 -0000 Received: (qmail 77744 invoked by uid 500); 3 Feb 2010 12:00:36 -0000 Delivered-To: apmail-incubator-uima-user-archive@incubator.apache.org Received: (qmail 77700 invoked by uid 500); 3 Feb 2010 12:00:36 -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 77690 invoked by uid 99); 3 Feb 2010 12:00:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Feb 2010 12:00:36 +0000 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: domain of msa@schor.com designates 69.41.242.20 as permitted sender) Received: from [69.41.242.20] (HELO gateway02.websitewelcome.com) (69.41.242.20) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 03 Feb 2010 12:00:28 +0000 Received: (qmail 4691 invoked from network); 3 Feb 2010 12:00:45 -0000 Received: from gator74.hostgator.com (67.18.27.130) by gateway02.websitewelcome.com with SMTP; 3 Feb 2010 12:00:45 -0000 Received: from ool-44c6c63b.dyn.optonline.net ([68.198.198.59]:10966 helo=[192.168.1.100]) by gator74.hostgator.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Ncdtu-0004a5-31 for uima-user@incubator.apache.org; Wed, 03 Feb 2010 06:00:06 -0600 Message-ID: <4B696548.70400@schor.com> Date: Wed, 03 Feb 2010 07:00:08 -0500 From: Marshall Schor User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: uima-user@incubator.apache.org Subject: Re: CPM class usage References: In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator74.hostgator.com X-AntiAbuse: Original Domain - incubator.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - schor.com Radwen ANIBA wrote: > Hello, > > I have devoloped a serie of AEs that I tested through CPE GUI,and now I'm > trying to write a java aplication using these AEs and trying to do th same > thing as CPE GUI. So I took as reference SimpleRunCPM example and I made > these changes > > // create a new Collection Processing Manager > mCPM = UIMAFramework.newCollectionProcessingManager(); > > // Register AE and CAS Consumer with the CPM > mCPM.setAnalysisEngine(ae1); > mCPM.setAnalysisEngine(ae2); > mCPM.setAnalysisEngine(ae3); > mCPM.setAnalysisEngine(ae4); > > Notice here I have 4 ae and not only one > > So when running this I have an error message in mCPM.setAnalysisEngine(ae2) > saying > > Initializing AnalysisEngines > Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, > Size: 0 > at java.util.LinkedList.entry(LinkedList.java:365) > at java.util.LinkedList.remove(LinkedList.java:357) > at > org.apache.uima.collection.impl.cpm.engine.CPMEngine.removeCasProcessor(CPMEngine.java:1188) > at > org.apache.uima.collection.impl.cpm.BaseCPMImpl.removeCasProcessor(BaseCPMImpl.java:361) > at > org.apache.uima.collection.impl.cpm.CPMImpl.setAnalysisEngine(CPMImpl.java:70) > > So I don't know what is really the problem, if CPM do not take up to one ae > or this is a problem in ae2 that I already tried without any bug. > Looking at the code, it appears that the CPMImpl class has two different approaches for managing Analysis Engines AE. One approach assumes there is only one AE. This approach is used with methods like setAnalysisEngine, getAnalysisEngine, etc. These set and remove the one (and only) AE. If you try and set more than one AE, the previously set AE is removed, and the next AE is substituted for it, which is not what you are trying to do, of course. There are other methods that permit multiple analysis engines. These are methods like addCasProcessor. Try changing setAnalysisEngine to addCasProcessor. The error stack trace reveals this part of the framework code is buggy. I'll submit a bug report. -Marshall > Any idea ? > > Thx > > Rad > >