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 75E9A200C89 for ; Sat, 3 Jun 2017 08:27:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 74CCB160BCD; Sat, 3 Jun 2017 06:27:29 +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 95070160BBE for ; Sat, 3 Jun 2017 08:27:28 +0200 (CEST) Received: (qmail 56392 invoked by uid 500); 3 Jun 2017 06:27:26 -0000 Mailing-List: contact dev-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@spark.apache.org Received: (qmail 56372 invoked by uid 99); 3 Jun 2017 06:27:26 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Jun 2017 06:27:26 +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 15922C0E1F for ; Sat, 3 Jun 2017 06:27:26 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.38 X-Spam-Level: ** X-Spam-Status: No, score=2.38 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=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-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id R-W-6XRSNi-p for ; Sat, 3 Jun 2017 06:27:24 +0000 (UTC) Received: from mail-qk0-f170.google.com (mail-qk0-f170.google.com [209.85.220.170]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 917125F2AE for ; Sat, 3 Jun 2017 06:27:24 +0000 (UTC) Received: by mail-qk0-f170.google.com with SMTP id p66so57214974qkf.3 for ; Fri, 02 Jun 2017 23:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=oSnA37640AT3u5Ky7ITX1ztbFBvIA5pDLVk2CoG9Iaw=; b=rbfmxJhaJgMjYftBunTsZBsZJlaY56VsBAd1Ozyi+lP9uCBHIWHZFd6Yq/K05tZPNg TMhUZgbEjLcAMtcIqOg67DqyYhJ1W/IjDvBUj9VU2jnEKZos0iiyxOZeLT5c8QPKMety SUVY3AtrIfnYyX58EtnvDAOuWafALXPkmXRyRl1/RWz/NMib56WieYCQofTyut0Ykyb8 fC4+TYBJEGtAIOe75S1rvtBpwVX/8pfkqz0k/hH+9/cWv+859frAlkGm7tnCSpKkbdM5 LGZkL/sLBcMFMpNkKE8N4xXBowDKpLfsBQKaOwSRxABXuqdwPj/w7hHjH6asFfvFKie5 QNTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=oSnA37640AT3u5Ky7ITX1ztbFBvIA5pDLVk2CoG9Iaw=; b=j6drX60Pd0jQbce0hz39wIsTlt6OirrI75ZElXDRxN55ibPWZQYETh3KphE0o3JQCA DfhohilcBjM4JCD/kwo36ROU7bYOUsnV7gl+HOdkz0R449Qv5T9QlT/oAAsvHff+4tGg P9gW0NknL7HJIrFJ0t2IBTh8exiNBwlo8gSth03QUuf5ZdcxvtRBYzJYAg8bBd4+99Y9 96TdQkjgIjjnRt+KX0911kmMsOiru/5OQ4kd3DfQOPue2mYdpSSy8Z2wo6qqBdBdtWCk 8xMQrAJfP+VnMORsxI5NEoCMinnnoOCJmX9Tr79+tnwCuVGYKx5UST87hkfAT6ReecMX Hn0w== X-Gm-Message-State: AKS2vOz99joQ2Mm5wDhjWiu9nF76d8fvNo5LyqDccM04AahowcSu/7KN l8EJWyY+oGY6jhyEyjQR4qsOzJcv7w== X-Received: by 10.55.88.194 with SMTP id m185mr13153640qkb.230.1496471238572; Fri, 02 Jun 2017 23:27:18 -0700 (PDT) MIME-Version: 1.0 References: <6a995af4-ed42-8966-9617-84f04ac27cb1@gmail.com> In-Reply-To: <6a995af4-ed42-8966-9617-84f04ac27cb1@gmail.com> From: Georg Heiler Date: Sat, 03 Jun 2017 06:27:07 +0000 Message-ID: Subject: Re: spark messing up handling of native dependency code? To: Maciej Szymkiewicz , dev@spark.apache.org Content-Type: multipart/alternative; boundary="001a114e737c9780c30551085c8f" archived-at: Sat, 03 Jun 2017 06:27:29 -0000 --001a114e737c9780c30551085c8f Content-Type: text/plain; charset="UTF-8" When tested without any parallelism the same problem persists. Actually, NiFi shows the same issues. So probably it is not related to spark. Maciej Szymkiewicz schrieb am Sa., 3. Juni 2017 um 01:37 Uhr: > Maybe not related, but in general geotools are not thread safe,so using > from workers is most likely a gamble. > On 06/03/2017 01:26 AM, Georg Heiler wrote: > > Hi, > > There is a weird problem with spark when handling native dependency code: > I want to use a library (JAI) with spark to parse some spatial raster > files. Unfortunately, there are some strange issues. JAI only works when > running via the build tool i.e. `sbt run` when executed in spark. > > When executed via spark-submit the error is: > > java.lang.IllegalArgumentException: The input argument(s) may not be > null. > at > javax.media.jai.ParameterBlockJAI.getDefaultMode(ParameterBlockJAI.java:136) > at > javax.media.jai.ParameterBlockJAI.(ParameterBlockJAI.java:157) > at > javax.media.jai.ParameterBlockJAI.(ParameterBlockJAI.java:178) > at > org.geotools.process.raster.PolygonExtractionProcess.execute(PolygonExtractionProcess.java:171) > > Which looks like some native dependency (I think GEOS is running in the > background) is not there correctly. > > Assuming something is wrong with the class path I tried to run a plain > java/scala function. but this one works just fine. > > Is spark messing with the class paths? > > I created a minimal example here: > https://github.com/geoHeil/jai-packaging-problem > > > Hope someone can shed some light on this problem, > Regards, > Georg > > > --001a114e737c9780c30551085c8f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When tested without any parallelism the same problem persi= sts. Actually, NiFi shows the same issues. So probably it is not related to= spark.

=20 =20 =20

Maybe not related, but in general geotools are not thread safe,so using from workers is most likely a gamble.

On 06/03/2017 01:2= 6 AM, Georg Heiler wrote:
Hi,

There is a weird problem with spark when handling native dependency code:
I want to use a library (JAI) with spark to parse some spatial raster files. Unfortunately, there are some strange issues. JAI only works when running via the build tool i.e. `sbt run` when executed in spark.

When executed via spark-submit the error is:

=C2=A0 =C2=A0 java.lang.IllegalArgumentException: The input argument(s) may not be null.
=C2=A0 =C2=A0 at javax.media.jai.ParameterBlockJAI.getDefaultMode(ParameterBlockJAI.java:136= )

--001a114e737c9780c30551085c8f--