Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 28471200C17 for ; Fri, 10 Feb 2017 22:32:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 26BEC160B4E; Fri, 10 Feb 2017 21:32:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4C755160B5C for ; Fri, 10 Feb 2017 22:32:05 +0100 (CET) Received: (qmail 31006 invoked by uid 500); 10 Feb 2017 21:31:59 -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 30989 invoked by uid 99); 10 Feb 2017 21:31:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Feb 2017 21:31:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 971D21A02E3 for ; Fri, 10 Feb 2017 21:31:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.398 X-Spam-Level: ** X-Spam-Status: No, score=2.398 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id sgPldef4kjvi for ; Fri, 10 Feb 2017 21:31:56 +0000 (UTC) Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 905635F576 for ; Fri, 10 Feb 2017 21:31:55 +0000 (UTC) Received: by mail-oi0-f44.google.com with SMTP id j15so28285607oih.2 for ; Fri, 10 Feb 2017 13:31:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=S9LNoo5QtZ4O/gEK1MxbGkhkJzoY2Q6kxDhlaaK51xM=; b=F4bDO+0AAu7025pRCEHopP33JaiFGFL992mwyvEufATCc9NkF9VWN5HW/HrCy/2ikU fDgnraw2qkyUxsUCMlxl5LHd1Rqj0UVL9rujlsEec7ItiDsji++7EVplpl0+pf9K2J5y a/hGs90BXGVnP9Ot7iS8jJ8iXkGgOvjZWGNteDpJnzvLEDKuPUlKGnwLmylr8BYkQTyk MeZQhT+9rsI6K9/YgU6H0b15oHPt8BTsNRUjDJtCr5kBCxVuPEjFq9eHxbDUxpU4Yxmb PP1qXGZ4RosECs1qIm1FXeCWx9xrhbNH2U0FmWeQRcOsatvbIo+/3p1SSO9w8wn6DuDN XocQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=S9LNoo5QtZ4O/gEK1MxbGkhkJzoY2Q6kxDhlaaK51xM=; b=cxYQWaotHhYmHvYmnuvHRNUIGTdaw6odCiJCxZ3dpMMH17wuITx+egWWdVajh5rbsw xj75VGQ7mxakPOZW6YzaRwi30j9V2hUbVX0B+u+vu6vQ0nCufEM6R6w/xmfzUzT1lozj /AUj6b5RghnF34YTNMFJBG1bTmwBXysWZUXrdB22rG8hNhPGKF9Gzkbv/xKPnX4feknl wZHXrm0nMX60ybeVs18ehJ0wQZyewVWZJT/DYyE1WKPs7wwSwdPQqRUXYRCcWaxIlIer YoTz1ikmK7mUg6Z4DU2Z/Fsra8sWPR2tvqPfKrA/j+yr5j598A/sqWviMRLdNXR81aGB D2Fg== X-Gm-Message-State: AMke39mKxDmFy3hsF9UfPuV5gTyJnW2X+ONJa29r5o0NPCtqNRNxaJGKjbVaX5vU0Xz0XwOKi9GT4wMGg+ubWA== X-Received: by 10.202.90.135 with SMTP id o129mr5943975oib.69.1486762309753; Fri, 10 Feb 2017 13:31:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.24.76 with HTTP; Fri, 10 Feb 2017 13:31:49 -0800 (PST) In-Reply-To: References: <7553f52f-f307-9e50-4289-290f6d5a32b4@schor.com> From: Jaroslaw Cwiklik Date: Fri, 10 Feb 2017 16:31:49 -0500 Message-ID: Subject: Re: Many views in the cas to serialize cause java.lang.NullPointerException in service uima-as To: user@uima.apache.org Content-Type: multipart/alternative; boundary=001a113d54fe56a5a1054833d394 archived-at: Fri, 10 Feb 2017 21:32:06 -0000 --001a113d54fe56a5a1054833d394 Content-Type: text/plain; charset=UTF-8 Is this a primitive (single-threaded) aggregate or async (multi-threaded)? If async, try to simplify and run primitive aggregate with scaleout=1. The CAS does not seem to be null in this case. The caller of the getSerializedCas() checks for null. The code dies here: Caused by: java.lang.NullPointerException at org.apache.uima.cas.impl.CasSerializerSupport$ CasDocSerializer.getSofaAddr(CasSerializerSupport.java:454) public int getSofaAddr(int sofaNum) { if (sofaNum != 1 || cas.isInitialSofaCreated()) { //skip if initial view && no Sofa yet // all non-initial-views must have a sofa * return ((CASImpl)cas.getView(sofaNum)).getSofaRef();* } return 0; } Looks to me that getView(sofaNum) is returning null. Is it possible that two threads are operating on the same CAS maybe? One removing a view while another trying to serialize. Have no idea what else could it be. -jerry On Fri, Feb 10, 2017 at 8:45 AM, nelson rivera wrote: > Hi, The first thing I did was these tests,i made a simple test case > that create a Cas with 17 views and then serialize using > XmiCasSerializer.serialize(newJCas.getCas(), fis) and serializes > correctly. > Also i made other test, initialize the same AE but of local way with > UIMA API and process the same input documents and the processing is > correct and then serialize the CAS, without problem. > > The error is with AE deployed in uima-as and consuming it. > > 2017-02-09 17:30 GMT-05:00, Marshall Schor : > > one thing that would help track this down is a small isolated test case. > > > > Do you think uima-as is needed? I'm wondering if a simple test case which > > generated 17 views and then tried to serialize would show the failure... > > > > If you could supply a small test case that showed the failure so we could > > reproduce it, that would enable a rapid resolution. > > > > -Marshall > > > > > > On 2/9/2017 3:58 PM, Marshall Schor wrote: > >> The line throwing the null pointer exception is : > >> > >> cas.getView(sofaNum).getSofaRef() > >> > >> So the NPE is either the cas is null, or the getView(sofaNum) is > returning > >> null. > >> > >> I'm not sure what the best way is to debug this... > >> > >> -Marshall > >> > >> > >> > >> > >> On 2/9/2017 12:42 PM, nelson rivera wrote: > >>> I have a aggregate service uima-as, at the end of aggregate the cas to > >>> return is composed of as many views as the number of input files, each > >>> view with annotations of processing. > >>> With a number of input documents less than 15 the processing is > >>> successful always, > >>> but if the number of documents is greater than 15, i get a > >>> NullPointerException at the aggregate service trying to serialize the > >>> cas, not in the processing of AE aggregate. > >>> the logs of aggregate service: > >>> > >>> 11:51:38.815 - 42: > >>> cu.datys.xinetica.uima.core.MergerInViewCasMultipler.hasNext(285): > >>> INFO: HasNext false > >>> 11:51:38.875 - 44: > >>> org.apache.uima.uimacpp.UimacppAnalysisComponent.log(396): INFO: : > >>> XClusterAnalyzer::process --- OK > >>> 11:51:39.145 - 45: > >>> org.apache.uima.aae.controller.AggregateAnalysisEngineControl > ler_impl.replyToClient: > >>> WARNING: Service: XClusterAnalyzerAggregate Runtime Exception > >>> 11:51:39.145 - 45: > >>> org.apache.uima.aae.controller.AggregateAnalysisEngineControl > ler_impl.replyToClient: > >>> WARNING: > >>> org.apache.uima.aae.error.AsynchAEException: > >>> org.apache.uima.UIMARuntimeException > >>> at > >>> org.apache.uima.adapter.jms.activemq.JmsOutputChannel. > getSerializedCas(JmsOutputChannel.java:1265) > >>> at > >>> org.apache.uima.adapter.jms.activemq.JmsOutputChannel. > sendReply(JmsOutputChannel.java:800) > >>> at > >>> org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl. > sendReplyToRemoteClient(AggregateAnalysisEngineController_impl.java:2173) > >>> at > >>> org.apache.uima.aae.controller.AggregateAnalysisEngineControl > ler_impl.replyToClient(AggregateAnalysisEngineController_impl.java:2342) > >>> at > >>> org.apache.uima.aae.controller.AggregateAnalysisEngineControl > ler_impl.finalStep(AggregateAnalysisEngineController_impl.java:1862) > >>> at > >>> org.apache.uima.aae.controller.AggregateAnalysisEngineControl > ler_impl.executeFlowStep(AggregateAnalysisEngineController_impl.java:2489) > >>> at > >>> org.apache.uima.aae.controller.AggregateAnalysisEngineControl > ler_impl.process(AggregateAnalysisEngineController_impl.java:1271) > >>> at > >>> org.apache.uima.aae.handler.HandlerBase.invokeProcess( > HandlerBase.java:118) > >>> at > >>> org.apache.uima.aae.handler.input.ProcessResponseHandler. > cancelTimerAndProcess(ProcessResponseHandler.java:117) > >>> at > >>> org.apache.uima.aae.handler.input.ProcessResponseHandler. > handleProcessResponseWithCASReference(ProcessResponseHandler.java:485) > >>> at > >>> org.apache.uima.aae.handler.input.ProcessResponseHandler. > handle(ProcessResponseHandler.java:767) > >>> at > >>> org.apache.uima.aae.handler.HandlerBase.delegate(HandlerBase.java:149) > >>> at > >>> org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handle( > ProcessRequestHandler_impl.java:1113) > >>> at > >>> org.apache.uima.aae.spi.transport.vm.UimaVmMessageListener.onMessage( > UimaVmMessageListener.java:107) > >>> at > >>> org.apache.uima.aae.spi.transport.vm.UimaVmMessageDispatcher$1.run( > UimaVmMessageDispatcher.java:70) > >>> at > >>> java.util.concurrent.ThreadPoolExecutor.runWorker( > ThreadPoolExecutor.java:1145) > >>> at > >>> java.util.concurrent.ThreadPoolExecutor$Worker.run( > ThreadPoolExecutor.java:615) > >>> at > >>> org.apache.uima.aae.UimaAsThreadFactory$1.run( > UimaAsThreadFactory.java:132) > >>> at java.lang.Thread.run(Thread.java:745) > >>> Caused by: org.apache.uima.UIMARuntimeException > >>> at > >>> org.apache.uima.cas.impl.XmiCasSerializer.serialize( > XmiCasSerializer.java:420) > >>> at > >>> org.apache.uima.cas.impl.XmiCasSerializer.serialize( > XmiCasSerializer.java:385) > >>> at > >>> org.apache.uima.aae.UimaSerializer.serializeCasToXmi( > UimaSerializer.java:145) > >>> at > >>> org.apache.uima.adapter.jms.activemq.JmsOutputChannel. > serializeCAS(JmsOutputChannel.java:251) > >>> at > >>> org.apache.uima.adapter.jms.activemq.JmsOutputChannel. > getSerializedCas(JmsOutputChannel.java:1250) > >>> ... 18 more > >>> Caused by: java.lang.NullPointerException > >>> at > >>> org.apache.uima.cas.impl.CasSerializerSupport$ > CasDocSerializer.getSofaAddr(CasSerializerSupport.java:454) > >>> at > >>> org.apache.uima.cas.impl.CasSerializerSupport$CasDocSerializer. > writeViewsCommons(CasSerializerSupport.java:465) > >>> at > >>> org.apache.uima.cas.impl.XmiCasSerializer$XmiDocSerializer.writeViews( > XmiCasSerializer.java:572) > >>> at > >>> org.apache.uima.cas.impl.CasSerializerSupport$ > CasDocSerializer.serialize(CasSerializerSupport.java:441) > >>> at > >>> org.apache.uima.cas.impl.XmiCasSerializer.serialize( > XmiCasSerializer.java:415) > >>> ... 22 more > >>> > >> > > > > > --001a113d54fe56a5a1054833d394--