From dev-return-48744-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Thu Dec 19 01:35:03 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 06C9918065B for ; Thu, 19 Dec 2019 02:35:02 +0100 (CET) Received: (qmail 5548 invoked by uid 500); 19 Dec 2019 01:35:02 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 5526 invoked by uid 99); 19 Dec 2019 01:35:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Dec 2019 01:35:01 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 956AAE12F2 for ; Thu, 19 Dec 2019 01:35:00 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 1172878027F for ; Thu, 19 Dec 2019 01:35:00 +0000 (UTC) Date: Thu, 19 Dec 2019 01:35:00 +0000 (UTC) From: "LEE PYUNG BEOM (Jira)" To: dev@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (IGNITE-12468) ClassCastException on thinClient in Apache Ignite MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 LEE PYUNG BEOM created IGNITE-12468: --------------------------------------- Summary: ClassCastException on thinClient in Apache Ignite Key: IGNITE-12468 URL: https://issues.apache.org/jira/browse/IGNITE-12468 Project: Ignite Issue Type: Bug Components: clients Affects Versions: 2.6 Reporter: LEE PYUNG BEOM =C2=A0 {code:java} ClientConfiguration cfg =3D new ClientConfiguration().setAddresses("127= .0.0.1:10800"); try (IgniteClient igniteClient =3D Ignition.startClient(cfg)) { System.out.println(">>> Thin client put-get example started."); final String CACHE_NAME =3D "put-get-example"; ClientCache cache =3D igniteClient.getOrCreateCach= e(CACHE_NAME); Person p =3D new Person(); //put HashMap hm =3D new HashMap(); hm.put(1, p); cache.put(1, hm); //get HashMap map =3D (HashMap)cache.ge= t(1); Person p2 =3D map.get(1); System.out.format(">>> Loaded [%s] from the cache.\n",p2); } catch (ClientException e) { System.err.println(e.getMessage()); e.printStackTrace(); } catch (Exception e) { System.err.format("Unexpected failure: %s\n", e); e.printStackTrace(); } {code} =C2=A0 I use the thin client of apache-ignite. I Create a hashmap and put the Person class(org.apache.ignite.examples.mode= l.Person) object into it. And when I take it out of the hashmap, I get the following exceptions: =C2=A0 {code:java} > java.lang.ClassCastException: > org.apache.enite.internal.binary.BinaryObjectImpl cannot be cast to > org.apache.engite.examples.model.Person. {code} An exception is given in the code below. =C2=A0 {code:java} Person p2 =3D map.get(1); {code} =C2=A0 However, there is no exception if I modify the code as follows: =C2=A0 {code:java} BinaryObject bo =3D (BinaryObject) map.get(1); Person p2 =3D bo.deserialize(); {code} I don't think that's necessary. Is there another solution? =C2=A0 -- This message was sent by Atlassian Jira (v8.3.4#803005)