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 0569D2009F7 for ; Sat, 7 May 2016 22:16:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 03C28160A01; Sat, 7 May 2016 20:16:52 +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 252181609F6 for ; Sat, 7 May 2016 22:16:50 +0200 (CEST) Received: (qmail 68823 invoked by uid 500); 7 May 2016 20:16:50 -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 68811 invoked by uid 99); 7 May 2016 20:16:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 May 2016 20:16:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7CCB9C0758 for ; Sat, 7 May 2016 20:16:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.198 X-Spam-Level: * X-Spam-Status: No, score=1.198 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Er9K6ez2OxL0 for ; Sat, 7 May 2016 20:16:47 +0000 (UTC) Received: from mail-pf0-f173.google.com (mail-pf0-f173.google.com [209.85.192.173]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 9CA4F5F3F5 for ; Sat, 7 May 2016 20:16:46 +0000 (UTC) Received: by mail-pf0-f173.google.com with SMTP id 77so61289757pfv.2 for ; Sat, 07 May 2016 13:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Y17C0u+a9l4tbnXnZ+gWM3JyGeLT3yKbsEwh3UUKXGk=; b=wNIiZAkHqmj187W2kvcIWaF3J7H4CxZE6f/8aIshREWQgh7zWUjhMpvAb8cKYD2PkP X1tz9wBspsDUr1IWTMWKQQ56ejF6LOka1ErpZ0sG/Uea6AN8Le4fflxqXgpitlzEgVlu NueIJyCkIl4HyTA4ioxKRIw7Ya3O6dG/giPJ5Ken1OjH419YNV4gEgHrzffY7gCUbmHq gA4Xrs0I8k1E5ICBzAE5ZzbbDR+j9YjwqjIrNHqeNEDJDH4an6AH5g1RVpxOr3U0vSx5 bqWWSEbzeIDN34TCxCUFGf2mAFqQIW3DMB5WtE/sYXSAythvo1qa+Djla1x9eiSRVaAj TfiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Y17C0u+a9l4tbnXnZ+gWM3JyGeLT3yKbsEwh3UUKXGk=; b=mJS6Y40Gnq0xXbMqNlLfXD/uPksOW/kWARE8Jh7o3wLgpR0T4LW0ZMSX3bm8VRN0Nj Gvaz4v+ExuWSrZkwT0p1GlfMp6Vt2hx+S3Gyyrcw3xWygVO5E4QtHDI/wkTzh7jpGRJk BztQA3IVo9262EUpnmNcyFzZiLZi/yXBZjwcxTZUNmxxP/w2wrqJcyaIAUkHrCkJgZpn 6safDgxnlMv/z4c9fOY83i5s8j+Y7plm2tdIchTc1I1L6/VRIinTtVuOKtIdpfGZymPr eogi7t65JHe6+LBjFdIJEs7LzgsvfN5MwASDPcsjK5R/k0TOf1pUIAlHNWUmUwsayYp/ Yc4A== X-Gm-Message-State: AOPr4FU1bBPDp/OgAZGtiONW0UIvCL73F4m3/CD6fmaFH6Z/pMQvxvkJ6y03Nmq1GhaRxbt936poaTvI9JQMJA== X-Received: by 10.98.65.90 with SMTP id o87mr38060556pfa.151.1462652199424; Sat, 07 May 2016 13:16:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.168.238 with HTTP; Sat, 7 May 2016 13:15:59 -0700 (PDT) In-Reply-To: References: From: "Pablo N. Mendes" Date: Sat, 7 May 2016 13:15:59 -0700 Message-ID: Subject: Re: No sofaFS for specified sofaRef found To: user@uima.apache.org Content-Type: multipart/alternative; boundary=94eb2c0bcaeec6dafd05324640d6 archived-at: Sat, 07 May 2016 20:16:52 -0000 --94eb2c0bcaeec6dafd05324640d6 Content-Type: text/plain; charset=UTF-8 Thanks for your reply. I did not generate the XMI. It was provided to me in a file and I could not for the life of me figure out why it wasn't parsing. Only after I added the sofa="1" it deserialized perfectly. So I figured I'd send a comment here to: 1) make it easier for others searching for this error message; 2) see if the community feels like it's worth changing the error message (so it's clearer) or the parsing code so that this is not an issue in the future (e.g. couldn't we assume sofa=1 when not specified?) Is CasCopier known to omit sofa=1 when generating XMI? I noticed you rewrote it for DKPro. Cheers, Pablo On Sat, May 7, 2016 at 6:46 AM, Richard Eckart de Castilho wrote: > Were you using a CasCopier for the generation of this XMI? > > Cheers, > > -- Richard > > > On 07.05.2016, at 00:30, Pablo N. Mendes wrote: > > > > Folks, > > I am getting "No sofaFS for specified sofaRef found" while trying to > > deserialize an XMI. I found the message a bit cryptic and didn't find > much > > help on the lazyweb, so I bit the bullet and spent a few hours poking > > around. It seems to be a missing "sofa" attribute. If the sofa attribute > > has the wrong value, then you get "xmi id is referenced but not > > defined" which is very nice and clear. But if you omit the sofa attribute > > you get "No sofaFS for specified sofaRef found" which is less informative > > IMHO. > > > > Extra info below. > > > > Cheers, > > Pablo > > > > $ diff cas1.xmi cas2.xmi > > 9c9 > > < > documentId="001"/> > > --- > >> > > > > > > > > > > VERSIONS > > > > 2.8.1 > > 2.1.0 > > > > JAVA CODE SNIPPET > > > > org.apache.uima.util.XmlCasDeserializer.deserialize(inputStream, > > jCas.getCas()); > > > > STACK TRACE > > > > Exception in thread "main" org.apache.uima.cas.CASRuntimeException: No > > sofaFS for specified sofaRef found. > > at org.apache.uima.cas.impl.CASImpl.getSofa(CASImpl.java:806) > > at > > > org.apache.uima.cas.impl.FSIndexRepositoryImpl.ll_addFS_common(FSIndexRepositoryImpl.java:2781) > > at > > > org.apache.uima.cas.impl.FSIndexRepositoryImpl.ll_addFS(FSIndexRepositoryImpl.java:2763) > > at > > > org.apache.uima.cas.impl.FSIndexRepositoryImpl.addFS(FSIndexRepositoryImpl.java:2068) > > at > > > org.apache.uima.cas.impl.XmiCasDeserializer$XmiCasDeserializerHandler.endDocument(XmiCasDeserializer.java:1486) > > at > > > org.apache.uima.util.XmlCasDeserializer$XmlCasDeserializerHandler.endDocument(XmlCasDeserializer.java:127) > > at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown > Source) > > at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown > Source) > > at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source) > > at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source) > > at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source) > > at > > > org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown > > Source) > > at > > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown > > Source) > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) > > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) > > at > > > org.apache.uima.util.XmlCasDeserializer.deserialize(XmlCasDeserializer.java:83) > > at > > > org.apache.uima.util.XmlCasDeserializer.deserialize(XmlCasDeserializer.java:58) > > ... > > > > > > CAS1.xmi > > > > > > > xmlns:cas="http:///uima/cas.ecore" > > xmlns:tcas="http:///uima/tcas.ecore" > > xmlns:xmi="http://www.omg.org/XMI" > > xmlns:ls="http:///com/example.ecore" > > xmi:version="2.0"> > > > > > documentId="001"/> > > > sofaString="This is a test."/> > > > > > > > > > > CAS2.xmi > > > > > > > xmlns:cas="http:///uima/cas.ecore" > > xmlns:tcas="http:///uima/tcas.ecore" > > xmlns:xmi="http://www.omg.org/XMI" > > xmlns:ls="http:///com/example.ecore" > > xmi:version="2.0"> > > > > > > > sofaString="This is a test."/> > > > > > > > > > > TYPESYSTEM > > > > > > > > > > ExampleTypeSystem > > Just an example > > example.com > > 1.0 > > > > > > com.example.DocumentMetadata > > > > > > uima.tcas.DocumentAnnotation > > > > > > source > > Source > > > > uima.cas.String > > > > > > documentId > > Source > > > > uima.cas.String > > > > > > > > > > > > > > > > > > -- > > Pablo N. Mendes > > http://pablomendes.com > > -- Pablo N. Mendes http://pablomendes.com --94eb2c0bcaeec6dafd05324640d6--