Return-Path: X-Original-To: apmail-ignite-issues-archive@minotaur.apache.org Delivered-To: apmail-ignite-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1562F1892F for ; Tue, 15 Mar 2016 20:59:35 +0000 (UTC) Received: (qmail 44801 invoked by uid 500); 15 Mar 2016 20:59:34 -0000 Delivered-To: apmail-ignite-issues-archive@ignite.apache.org Received: (qmail 44646 invoked by uid 500); 15 Mar 2016 20:59:34 -0000 Mailing-List: contact issues-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 issues@ignite.apache.org Received: (qmail 44401 invoked by uid 99); 15 Mar 2016 20:59:34 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2016 20:59:34 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 35A252C1F54 for ; Tue, 15 Mar 2016 20:59:34 +0000 (UTC) Date: Tue, 15 Mar 2016 20:59:34 +0000 (UTC) From: "Valentin Kulichenko (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (IGNITE-2829) Unable to cache two beans with same class name but different package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IGNITE-2829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Valentin Kulichenko closed IGNITE-2829. --------------------------------------- > Unable to cache two beans with same class name but different package > -------------------------------------------------------------------- > > Key: IGNITE-2829 > URL: https://issues.apache.org/jira/browse/IGNITE-2829 > Project: Ignite > Issue Type: Bug > Components: cache > Affects Versions: 1.5.0.final > Environment: Tested on Windows and linux OS > Reporter: Kranthi Kiran > Fix For: 1.6 > > > Hi, > We are trying to cache two beans with same class name but different package and we are getting error something like below. Can you please help in this regards. After little debugging I found it is because of "org.apache.ignite.internal.binary.BinaryContext" line # 988, where only simple-class name is considered instead of full-qualified-class name. > Exception in thread "main" javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: Duplicate ID [id=-1146372286, oldCls=com.yodlee.ignite.test.sub1.TestBean, newCls=com.yodlee.ignite.test.sub2.TestBean > at org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1618) > ............... > Caused by: class org.apache.ignite.IgniteCheckedException: Duplicate ID [id=-1146372286, oldCls=com.yodlee.ignite.test.sub1.TestBean, newCls=com.yodlee.ignite.test.sub2.TestBean > at org.apache.ignite.internal.MarshallerContextAdapter.registerClass(MarshallerContextAdapter.java:163) > at org.apache.ignite.internal.binary.BinaryContext.registerUserClassDescriptor(BinaryContext.java:562) > ............... > ............. > Below is the test program I have written to simulate the problem > Main Program > =========== > public static void main(String[] args) > { > IgniteConfiguration config = new IgniteConfiguration(); > config.setClientMode(false); > config.setPeerClassLoadingEnabled(false); > > Ignite ignite = Ignition.start(config); > System.out.println("Server started..."); > > CacheConfiguration cacheConfig = new CacheConfiguration(); > cacheConfig.setName("test"); > IgniteCache testCache = ignite.getOrCreateCache(cacheConfig); > testCache.put("bean1", new TestBean("bean1")); > testCache.put("bean2", new com.yodlee.ignite.test.sub2.TestBean("bean2")); > > System.out.println("Completed"); > } > com.yodlee.ignite.test.sub1.TestBean > ============================ > package com.yodlee.ignite.test.sub1; > public class TestBean > { > private String name; > > public TestBean() > {} > > public TestBean(String name) > { > this.name = name; > } > public String getName() > { > return name; > } > public void setName(String name) > { > this.name = name; > } > } > com.yodlee.ignite.test.sub2.TestBean > ============================= > package com.yodlee.ignite.test.sub2; > public class TestBean > { > private String name; > > public TestBean() > {} > public TestBean(String name) > { > this.name = name; > } > public String getName() > { > return name; > } > public void setName(String name) > { > this.name = name; > } > } -- This message was sent by Atlassian JIRA (v6.3.4#6332)