From commits-return-11463-apmail-sis-commits-archive=sis.apache.org@sis.apache.org Mon Nov 26 11:49:17 2018 Return-Path: X-Original-To: apmail-sis-commits-archive@www.apache.org Delivered-To: apmail-sis-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 88902181D5 for ; Mon, 26 Nov 2018 11:49:17 +0000 (UTC) Received: (qmail 67152 invoked by uid 500); 26 Nov 2018 11:49:17 -0000 Delivered-To: apmail-sis-commits-archive@sis.apache.org Received: (qmail 67125 invoked by uid 500); 26 Nov 2018 11:49:17 -0000 Mailing-List: contact commits-help@sis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sis-dev@sis.apache.org Delivered-To: mailing list commits@sis.apache.org Received: (qmail 67106 invoked by uid 99); 26 Nov 2018 11:49:17 -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; Mon, 26 Nov 2018 11:49:17 +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 2D894C21DF for ; Mon, 26 Nov 2018 11:35:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id GorULfTaHAVc for ; Mon, 26 Nov 2018 11:35:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 5F79A5F47B for ; Mon, 26 Nov 2018 11:35:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A3FEEE0F4C for ; Mon, 26 Nov 2018 11:35:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5416927765 for ; Mon, 26 Nov 2018 11:35:00 +0000 (UTC) Date: Mon, 26 Nov 2018 11:35:00 +0000 (UTC) From: "Martin Desruisseaux (JIRA)" To: commits@sis.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (SIS-441) UnconvertibleObjectException when reading code list value from PostgreSQL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Martin Desruisseaux created SIS-441: --------------------------------------- Summary: UnconvertibleObjectException when reading code list v= alue from PostgreSQL Key: SIS-441 URL: https://issues.apache.org/jira/browse/SIS-441 Project: Spatial Information Systems Issue Type: Task Components: Metadata Affects Versions: 0.8 Reporter: Martin Desruisseaux Assignee: Martin Desruisseaux Fix For: 1.0 When metadata are read from database using {{org.apache.sis.sql.MetadataSou= rce}}, an attempt to get the {{CodeList}} value of a metadata entry produce= the following error: {noformat} org.apache.sis.util.collection.BackingStoreException: Database error while = creating a =E2=80=98Role=E2=80=99 object for the =E2=80=9CIOGP=E2=80=9D ide= ntifier. at org.apache.sis.metadata.sql.Dispatcher.invoke(Dispatcher.java:161) at org.apache.sis.metadata.sql.$Proxy233.getRole(Unknown Source) (=E2=80=A6snip=E2=80=A6) Caused by: org.apache.sis.metadata.sql.MetadataStoreException: Expected an= instance of =E2=80=98Role=E2=80=99 for the =E2=80=9Crole=E2=80=9D property= , but got an instance of =E2=80=98PGobject=E2=80=99. at org.apache.sis.metadata.sql.MetadataSource.readColumn(MetadataSourc= e.java:990) at org.apache.sis.metadata.sql.Dispatcher.fetchValue(Dispatcher.java:2= 27) at org.apache.sis.metadata.sql.Dispatcher.invoke(Dispatcher.java:159) Caused by: org.apache.sis.util.UnconvertibleObjectException: Can not conve= rt from type =E2=80=98PGobject=E2=80=99 to type =E2=80=98Role=E2=80=99. at org.apache.sis.internal.converter.ConverterRegistry.find(ConverterR= egistry.java:528) (=E2=80=A6snip=E2=80=A6) {noformat} This happen only with PostgreSQL database, because we store metadata as `VA= RCHAR` on Derby. The workaround is to read {{CodeList}}=C2=A0value using {{= ResultSet.getString(int)}} instead than {{ResultSet.getObject(=E2=80=A6)}},= so the {{PGobject}} is converted to a {{String}} that we can later parse a= s a {{CodeList}}. -- This message was sent by Atlassian JIRA (v7.6.3#76005)