Return-Path: X-Original-To: apmail-ctakes-user-archive@www.apache.org Delivered-To: apmail-ctakes-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 45DEB18B7A for ; Thu, 15 Oct 2015 06:36:10 +0000 (UTC) Received: (qmail 26559 invoked by uid 500); 15 Oct 2015 06:36:05 -0000 Delivered-To: apmail-ctakes-user-archive@ctakes.apache.org Received: (qmail 26510 invoked by uid 500); 15 Oct 2015 06:36:05 -0000 Mailing-List: contact user-help@ctakes.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ctakes.apache.org Delivered-To: mailing list user@ctakes.apache.org Received: (qmail 26484 invoked by uid 99); 15 Oct 2015 06:36:04 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Oct 2015 06:36:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 6EABAC0FC1 for ; Thu, 15 Oct 2015 06:36:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.898 X-Spam-Level: ** X-Spam-Status: No, score=2.898 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id tSbSd3LeAm3e for ; Thu, 15 Oct 2015 06:36:03 +0000 (UTC) Received: from mail-io0-f170.google.com (mail-io0-f170.google.com [209.85.223.170]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 38540439BE for ; Thu, 15 Oct 2015 06:36:03 +0000 (UTC) Received: by iow1 with SMTP id 1so80305824iow.1 for ; Wed, 14 Oct 2015 23:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=59mJA1LKNxKzLEns4rUJIN66fMIiKhCW8r+QvD8s8PA=; b=MhCkOQLBcvFAuVFSa1ps93Z/VsGW0JSHHEnLKc+lPUF9zj7T70Rv0otiYpgjVjhx/E CK8dFHlevjkkhS2pRd75d8psI3h51G7JE9LY2PWEyQIk16KyVDNyNrRkrwo3XHutpIp9 SsUR/9RipHALoaXn6RoIsy5hMID0Lrg7tkUcSRXQm30+PZeUvTiO6l+gH19ME6y9sfF/ 29/FBPM6iYVhBbHMCkREZZD7x/bS7ayDAqzXwIGXxQJAxenJkigV4rqOmNacsYlrccRb FM6iwir33EXvgMJsiJez1tXzvNia8sUu+R3FTpPhjZUsqdAazKNXtsZMQcamaTZ8YlU+ 8BzQ== MIME-Version: 1.0 X-Received: by 10.107.30.84 with SMTP id e81mr5909023ioe.137.1444890962658; Wed, 14 Oct 2015 23:36:02 -0700 (PDT) Received: by 10.36.93.70 with HTTP; Wed, 14 Oct 2015 23:36:02 -0700 (PDT) In-Reply-To: References: Date: Wed, 14 Oct 2015 23:36:02 -0700 Message-ID: Subject: Re: URI is not hierarchical when attempting to obtain lvg.properties within JAR From: Lewis John Mcgibbney To: user@ctakes.apache.org Content-Type: multipart/alternative; boundary=001a11418bf4918cd405221ee46a --001a11418bf4918cd405221ee46a Content-Type: text/plain; charset=UTF-8 Issue in Jira https://issues.apache.org/jira/browse/CTAKES-385 On Wed, Oct 14, 2015 at 10:55 PM, Lewis John Mcgibbney < lewis.mcgibbney@gmail.com> wrote: > Hi Folks, > I am using cTAKES 3.2.2 Maven dependencies. > I have some clinical pipeline code along with cTAKES dependencies and some > resources packaged into an uber jar which I am utilizing within my Spark > driver code. When I submit this to the Spark cluster I get a nasty stack > trace [0] with the following being important > > - Caused by: java.lang.IllegalArgumentException: URI is not hierarchical > - at java.io.File.(File.java:418) > - at org.apache.ctakes.lvg.ae.LvgAnnotator.createAnnotatorDescription(LvgAnnotator.java:565) > - at it.cnr.iac.CTAKESClinicalPipelineFactory.getTokenProcessingPipeline(CTAKESClinicalPipelineFactory.java:146) > > > The problem here is that > LvgAnnotator.createAnnotatorDescription(LvgAnnotator.java:565) looks as > follows > > ExternalResourceFactory.createExternalResourceDescription( > LvgCmdApiResourceImpl.class, > new File(LvgCmdApiResourceImpl.class.getResource( > "/org/apache/ctakes/lvg/data/config/lvg.properties").toURI())) > > > Here we should be using LvgCmdApiResourceImpl.class.getResourceAsStream, > the transformation to File should then be done if required within > ExternalResourceFactory.createExternalResourceDescription. > > The above is an issue which has been reported on a few occasions and a fix > somewhat proposed for a similar issue here [1][2]. > I am going to submit a patch for this and submit a test. I'll open an > issue in Jira. > Thanks > Lewis > > [0] https://paste.apache.org/gDJa > [1] https://issues.apache.org/jira/browse/CTAKES-307 > [2] https://issues.apache.org/jira/browse/CTAKES-89 > > -- > *Lewis* > -- *Lewis* --001a11418bf4918cd405221ee46a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Wed= , Oct 14, 2015 at 10:55 PM, Lewis John Mcgibbney <lewis.mcgibbney@= gmail.com> wrote:
Hi Folks,
I am using cTAKES 3.2.2 Maven de= pendencies.
I have some clinical pipeline code along with cTAKES d= ependencies and some resources packaged into an uber jar which I am utilizi= ng within my Spark driver code. When I submit this to the Spark cluster I g= et a nasty stack trace [0] with the following being important

  • Caused by: java.lang.Illeg= alArgumentException: URI is not hierarchical
  • at java.io.File.<i= nit>(File.java:418)
  • at org.apache.ctakes.lvg.ae.LvgAnnotator.cr= eateAnnotatorDescription(LvgAnnotator.java:565)
  • at it.cnr.iac.CTAK= ESClinicalPipelineFactory.getTokenProcessingPipeline(CTAKESClinicalPipeline= Factory.java:146)

  • The problem here is that LvgAnnotator= .createAnnotatorDescription(LvgAnnotator.java:565) looks as follows

    =
    ExternalResourceFactory.createExternalResourceDescription(
                  LvgCmdApiResourceImpl.class,
                  new File(LvgCmdApiResourceImpl.class.getResource(
                      "/org/apache/ctakes/lvg/data/config/lvg.properties&q=
    uot;).toURI()))

    Here we should be using LvgCmdApiResourceImpl= .class.getResourceAsStream, the transformation to File should then be done = if required within ExternalResourceFactory.createExternalResourceDescriptio= n.

    The above is an issue which has been reported o= n a few occasions and a fix somewhat proposed for a similar issue here [1][= 2].
    I am going to submit a patch for this and submit a test. = I'll open an issue in Jira.
    Thanks
    Lewis



    --
    Lewis <= br>
    --001a11418bf4918cd405221ee46a--