Return-Path: X-Original-To: apmail-groovy-users-archive@minotaur.apache.org Delivered-To: apmail-groovy-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2229F18AF7 for ; Tue, 18 Aug 2015 23:13:48 +0000 (UTC) Received: (qmail 73359 invoked by uid 500); 18 Aug 2015 23:13:47 -0000 Delivered-To: apmail-groovy-users-archive@groovy.apache.org Received: (qmail 73322 invoked by uid 500); 18 Aug 2015 23:13:47 -0000 Mailing-List: contact users-help@groovy.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.incubator.apache.org Delivered-To: mailing list users@groovy.incubator.apache.org Received: (qmail 73312 invoked by uid 99); 18 Aug 2015 23:13:47 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Aug 2015 23:13:47 +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 2A901C0BCF for ; Tue, 18 Aug 2015 23:13:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.001 X-Spam-Level: **** X-Spam-Status: No, score=4.001 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, KAM_LIVE=1, URIBL_BLOCKED=0.001] autolearn=disabled 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 M_wbsogugSCv for ; Tue, 18 Aug 2015 23:13:35 +0000 (UTC) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com [209.85.223.181]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 0F92042B29 for ; Tue, 18 Aug 2015 23:13:35 +0000 (UTC) Received: by iodb91 with SMTP id b91so207159856iod.1 for ; Tue, 18 Aug 2015 16:13:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=QeAEnopvW8gPguJ1PJtydLAGBFWvLF4r4wS5wmEsZ4w=; b=lqlMktdr8A9HG6nwkX81NWd6rknYO0SomKfPcQL1ntIbFCWkXo9SnJkT7q1tqhbTbJ bvDAOjCXRUou1UYWRA2NuaKfzCNNgvPQPuOMLRFVrrLLnaw1loAwWN/jgAdTqotfyvrr +TXgpAPrGFLH4uco5zRZpxwU2ngKdxIm58RiB2YuOjTHIcaIx6nI/P68WAImtfFVKMJT voDJdcjRWsj6Ky5//XM6vCZefCfY1eTI8CJ0u9nhKDh0ed39tZni4lDJRsM1VFklwE8d qfFSN6UNBQq1JzfTG/wlDsklpiB57pXqcRbzHWCVsiY3iFjqRo3rlD6ZcyqEJmFAs2rO eLCg== X-Gm-Message-State: ALoCoQmN+n+0iQTe/M7PsjVfcWbTVlj/JtIhqNqd+TtTtk90PfBDBfNJU+zs8+89EQo+OcCbvrpg X-Received: by 10.107.9.24 with SMTP id j24mr9156228ioi.26.1439939614345; Tue, 18 Aug 2015 16:13:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.129.217 with HTTP; Tue, 18 Aug 2015 16:13:14 -0700 (PDT) In-Reply-To: <55D2E184.30000@gmx.org> References: <55D2E184.30000@gmx.org> From: William Markito Date: Tue, 18 Aug 2015 16:13:14 -0700 Message-ID: Subject: Re: java.lang.LinkageError: loader constraint violation in interface itable To: users@groovy.incubator.apache.org Content-Type: multipart/alternative; boundary=001a113f9836362460051d9e113a --001a113f9836362460051d9e113a Content-Type: text/plain; charset=UTF-8 Thanks Jochen, but even with the system classloader I have the same issue. ------------------------------ @GrabConfig(systemClassLoader= true) @GrabResolver(name='asf-snapshots', root=" https://repository.apache.org/content/repositories/snapshots") @Grapes( @Grab(group="org.apache.geode", module = "gemfire-core", version = "1.0.0-incubating-SNAPSHOT") ) import com.gemstone.gemfire.cache.client.ClientCache import com.gemstone.gemfire.cache.client.ClientCacheFactory cache = new ClientCacheFactory() .addPoolLocator("localhost", 10334) .create(); region = cache.createClientRegionFactory("myRegion") region.put("1","Hello") region.put("2","World") -------------------- Caught: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "com.gemstone.gemfire.internal.cache.control.InternalResourceManager$DummyMemoryPoolMXBean.getObjectName()Ljavax/management/ObjectName;" the class loader (instance of org/codehaus/groovy/tools/RootLoader) of the current class, com/gemstone/gemfire/internal/cache/control/InternalResourceManager$DummyMemoryPoolMXBean, and the class loader (instance of ) for interface java/lang/management/PlatformManagedObject have different Class objects for the type javax/management/ObjectName used in the signature [info 2015/08/18 16:11:16.526 PDT tid=0xe] VM is exiting - shutting down distributed system java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "com.gemstone.gemfire.internal.cache.control.InternalResourceManager$DummyMemoryPoolMXBean.getObjectName()Ljavax/management/ObjectName;" the class loader (instance of org/codehaus/groovy/tools/RootLoader) of the current class, com/gemstone/gemfire/internal/cache/control/InternalResourceManager$DummyMemoryPoolMXBean, and the class loader (instance of ) for interface java/lang/management/PlatformManagedObject have different Class objects for the type javax/management/ObjectName used in the signature at com.gemstone.gemfire.internal.cache.control.InternalResourceManager.(InternalResourceManager.java:469) at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.(GemFireCacheImpl.java:755) at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.create(GemFireCacheImpl.java:667) at com.gemstone.gemfire.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:207) at com.gemstone.gemfire.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:162) at com.gemstone.gemfire.cache.client.ClientCacheFactory$create$0.call(Unknown Source) at HelloWorld.run(HelloWorld.groovy:16) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) On Tue, Aug 18, 2015 at 12:40 AM, Jochen Theodorou wrote: > Am 18.08.2015 03:53, schrieb William Markito: > >> Hi folks, >> >> Any recommendations for the following problem ? I'm not sure it's a >> problem on Geode implementation.. >> >> Thanks! >> >> ---- Groovy Code -- >> >> @GrabResolver(name='asf-snapshots', root=" >> https://repository.apache.org/content/repositories/snapshots") >> @Grapes( >> @Grab(group="org.apache.geode", module ="gemfire-core", version >> ="1.0.0-incubating-SNAPSHOT") >> ) >> >> importcom.gemstone.gemfire.cache.client.ClientCache >> importcom.gemstone.gemfire.cache.client.ClientCacheFactory >> >> >> cache =newClientCacheFactory() >> .addPoolLocator("localhost",10334) >> .create(); >> >> ----- >> ------ Exception >> >> Caught: java.lang.LinkageError: loader constraint violation in interface >> > [...] > > basically it means the bootloader is loading javax.management classes and > the RootLoader does so as well.. for the same classes. RootLoader is a > child of the bootloader and is normally supposed to redirect request to its > parent for class requests and only react if the parent cannot. Now > RootLoader violates that constraint on purpose and in most cases this is > fine... as long as no normal java classes are involved with that. > > This means the configuration for RootLoader contains a path, that also > includes javax.management classes, that duplicate the ones from the jdk. > That should not be the case and they should be removed. If you could find > out where those come from, it would help a lot. Or are you simply using the > default distribution of Groovy? If yes, then we might have to remove a jar > in there. That would fix the issue I think. If of course those classes come > from gemfire I would argue gemfire is doing something wrong here. Because > normally RootLoader is used to add those jars to. > > A @GrabExclude could be used if those classes are pulled in through a > dependency of gemfire-core (in that case we should check if the dependency > is optional) > > As an alternative you could try to use @GrabConfig(systemClassLoader=true) > inside the @Grapes. This will force the Gemfire classes being loaded by the > system loader instead, bypassing the issue above maybe. > > bye blackdrag > > > > itable initialization: when resolving method >> >> "com.gemstone.gemfire.internal.cache.control.InternalResourceManager$DummyMemoryPoolMXBean.getObjectName()Ljavax/management/ObjectName;" >> the class loader (instance of org/codehaus/groovy/tools/RootLoader) of >> the current class, >> >> com/gemstone/gemfire/internal/cache/control/InternalResourceManager$DummyMemoryPoolMXBean, >> and the class loader (instance of ) for interface >> java/lang/management/PlatformManagedObject have different Class objects >> for the type javax/management/ObjectName used in the signature >> [info 2015/08/17 18:36:43.352 PDT >> tid=0xe] VM is exiting - shutting down distributed system >> java.lang.LinkageError: loader constraint violation in interface itable >> initialization: when resolving method >> >> "com.gemstone.gemfire.internal.cache.control.InternalResourceManager$DummyMemoryPoolMXBean.getObjectName()Ljavax/management/ObjectName;" >> the class loader (instance of org/codehaus/groovy/tools/RootLoader) of >> the current class, >> >> com/gemstone/gemfire/internal/cache/control/InternalResourceManager$DummyMemoryPoolMXBean, >> and the class loader (instance of ) for interface >> java/lang/management/PlatformManagedObject have different Class objects >> for the type javax/management/ObjectName used in the signature >> >> > > -- > Jochen "blackdrag" Theodorou > blog: http://blackdragsview.blogspot.com/ > > -- William Markito Oliveira Enterprise Architect -- For questions about Apache Geode, please write to *dev@geode.incubator.apache.org * --001a113f9836362460051d9e113a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks=C2=A0Jochen, but even with the system classloader I hav= e the same issue.

------------------------------
@GrabConfig(systemClassLoader=3D true)
@GrabR= esolver(name=3D'asf-snapshots', root=3D"https://repository.apache.org/content/repositories/snapsh= ots")
@Grapes(
@Grab(group=3D"org.apache.geode&quo= t;
, module =3D &= quot;gemfire-core", version =3D "1.0.0-incubating-SNAPSHOT")
)
=
import com.ge= mstone.gemfire.cache.client.ClientCache
import com.gemstone.gemfire.cache.client.ClientCa= cheFactory


cache =3D new ClientCacheFactory()
.addPoolLocator("localhost", <= span style=3D"color:rgb(0,0,255)">10334)
.create();
region =3D cache.createClientRegionFactory("myRegion")

region.put("1","Hello")
re= gion.put("2"<= /span>,"World"= ;)

=
--------------------
Caught: java.lang.LinkageError: loader constraint vi= olation in interface itable initialization: when resolving method "com= .gemstone.gemfire.internal.cache.control.InternalResourceManager$DummyMemor= yPoolMXBean.getObjectName()Ljavax/management/ObjectName;" the class lo= ader (instance of org/codehaus/groovy/tools/RootLoader) of the current clas= s, com/gemstone/gemfire/internal/cache/control/InternalResourceManager$Dumm= yMemoryPoolMXBean, and the class loader (instance of <bootloader>) fo= r interface java/lang/management/PlatformManagedObject have different Class= objects for the type javax/management/ObjectName used in the signature
[info 2015/08/= 18 16:11:16.526 PDT <Distributed system shutdown hook> tid=3D0xe] VM = is exiting - shutting down distributed system

java.lang.LinkageError: loader constraint vi= olation in interface itable initialization: when resolving method "com= .gemstone.gemfire.internal.cache.control.InternalResourceManager$DummyMemor= yPoolMXBean.getObjectName()Ljavax/management/ObjectName;" the class lo= ader (instance of org/codehaus/groovy/tools/RootLoader) of the current clas= s, com/gemstone/gemfire/internal/cache/control/InternalResourceManager$Dumm= yMemoryPoolMXBean, and the class loader (instance of <bootloader>) fo= r interface java/lang/management/PlatformManagedObject have different Class= objects for the type javax/management/ObjectName used in the signature
at com.gemstone.gemfire.= internal.cache.control.InternalResourceManager.<clinit>(InternalResou= rceManager.java:469)
= at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.<init>(GemFir= eCacheImpl.java:755)
= at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.create(GemFireCache= Impl.java:667)
at com= .gemstone.gemfire.cache.client.ClientCacheFactory.basicCreate(ClientCacheFa= ctory.java:207)
at = com.gemstone.gemfire.cache.client.ClientCacheFactory.create(ClientCacheFact= ory.java:162)
at com.= gemstone.gemfire.cache.client.ClientCacheFactory$create$0.call(Unknown Sour= ce)
at HelloWorld.run= (HelloWorld.groovy:16)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)


On Tue, Aug 18, 2015 at 12:40 AM, Jochen Theodorou <b= lackdrag@gmx.org> wrote:
Am 18.08.2015 03:53, schrieb William Markito:
Hi folks,

=C2=A0 =C2=A0Any recommendations for the following problem ? I'm not su= re it's a
problem on Geode implementation..

Thanks!

---- Groovy Code --

@GrabResolver(name=3D'asf-snapshots', root=3D"https://repository.apache.org/content/repositories/snaps= hots")
@Grapes(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0@Grab(group=3D"org.apache.geode"= ;, module =3D"gemfire-core", version =3D"1.0.0-incubating-SN= APSHOT")
)

importcom.gemstone.gemfire.cache.client.ClientCache
importcom.gemstone.gemfire.cache.client.ClientCacheFactory


cache =3DnewClientCacheFactory()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.addPoolLocator("localhost",103= 34)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.create();

-----
------=C2=A0 Exception

Caught: java.lang.LinkageError: loader constraint violation in interface
[...]

basically it means the bootloader is loading javax.management classes and t= he RootLoader does so as well.. for the same classes. RootLoader is a child= of the bootloader and is normally supposed to redirect request to its pare= nt for class requests and only react if the parent cannot. Now RootLoader v= iolates that constraint on purpose and in most cases this is fine... as lon= g as no normal java classes are involved with that.

This means the configuration for RootLoader contains a path, that also incl= udes javax.management classes, that duplicate the ones from the jdk. That s= hould not be the case and they should be removed. If you could find out whe= re those come from, it would help a lot. Or are you simply using the defaul= t distribution of Groovy? If yes, then we might have to remove a jar in the= re. That would fix the issue I think. If of course those classes come from = gemfire I would argue gemfire is doing something wrong here. Because normal= ly RootLoader is used to add those jars to.

A @GrabExclude could be used if those classes are pulled in through a depen= dency of gemfire-core (in that case we should check if the dependency is op= tional)

As an alternative you could try to use @GrabConfig(systemClassLoader=3Dtrue= ) inside the @Grapes. This will force the Gemfire classes being loaded by t= he system loader instead, bypassing the issue above maybe.

bye blackdrag



itable initialization: when resolving method
"com.gemstone.gemfire.internal.cache.control.InternalResourceManager$D= ummyMemoryPoolMXBean.getObjectName()Ljavax/management/ObjectName;"
the class loader (instance of org/codehaus/groovy/tools/RootLoader) of
the current class,
com/gemstone/gemfire/internal/cache/control/InternalResourceManager$DummyMe= moryPoolMXBean,
and the class loader (instance of <bootloader>) for interface
java/lang/management/PlatformManagedObject have different Class objects
for the type javax/management/ObjectName used in the signature
[info 2015/08/17 18:36:43.352 PDT <Distributed system shutdown hook><= br> tid=3D0xe] VM is exiting - shutting down distributed system
java.lang.LinkageError: loader constraint violation in interface itable
initialization: when resolving method
"com.gemstone.gemfire.internal.cache.control.InternalResourceManager$D= ummyMemoryPoolMXBean.getObjectName()Ljavax/management/ObjectName;"
the class loader (instance of org/codehaus/groovy/tools/RootLoader) of
the current class,
com/gemstone/gemfire/internal/cache/control/InternalResourceManager$DummyMe= moryPoolMXBean,
and the class loader (instance of <bootloader>) for interface
java/lang/management/PlatformManagedObject have different Class objects
for the type javax/management/ObjectName used in the signature



--
Jochen "blackdrag" Theodorou
blog: http://blackdragsview.blogspot.com/




--

William Markito Oliveira
<= div>Enterprise Architect=C2=A0
-- For q= uestions about Apache Geode, please write to=C2=A0= dev@geo= de.incubator.apache.org


--001a113f9836362460051d9e113a--