java.lang.ClassNotFoundException: org.eclipse.core.runtime.ILibrary cannot be found by org.eclipse.equinox.registry_3.5.301.v20130717-1549

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

java.lang.ClassNotFoundException: org.eclipse.core.runtime.ILibrary cannot be found by org.eclipse.equinox.registry_3.5.301.v20130717-1549

Jonathan Ozik
Hello all,

I've been trying to update to the snapshot Groovy Eclipse plugin on Kepler (http://dist.springsource.org/snapshot/GRECLIPSE/e4.3/) but I'm seeing that some plugins that we've developed that were previously working are experiencing what looks like classloading issues. I've included a typical stack trace below. The gist is that elements from the eclipse-core plugin are not being found once Groovy code is executed within our plugin despite the fact that the plugin does declare a dependency on eclipse-core. Like I mentioned, none of these issues exist with the current release build. Could this be an issue related to some custom class loading being done in Groovy?

Any help on this would be greatly appreciated,

Jonathan

java.lang.NoClassDefFoundError: [Lorg/eclipse/core/runtime/ILibrary;
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
        at java.lang.Class.privateGetPublicMethods(Class.java:2651)
        at java.lang.Class.getMethods(Class.java:1467)
        at org.codehaus.groovy.reflection.stdclasses.CachedSAMClass.getSAMMethod(CachedSAMClass.java:160)
        at org.codehaus.groovy.reflection.ClassInfo.isSAM(ClassInfo.java:323)
        at org.codehaus.groovy.reflection.ClassInfo.createCachedClass(ClassInfo.java:313)
        at org.codehaus.groovy.reflection.ClassInfo.access$400(ClassInfo.java:37)
        at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:484)
        at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:475)
        at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
        at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
        at org.codehaus.groovy.reflection.ClassInfo.getCachedClass(ClassInfo.java:94)
        at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:107)
        at org.codehaus.groovy.reflection.ParameterTypes.getParametersTypes0(ParameterTypes.java:78)
        at org.codehaus.groovy.reflection.ParameterTypes.getParameterTypes(ParameterTypes.java:64)
        at org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.isMatchingMethod(MetaMethodIndex.java:450)
        at org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.addMethodToList(MetaMethodIndex.java:375)
        at groovy.lang.MetaClassImpl.addMetaMethodToIndex(MetaClassImpl.java:2742)
        at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java:317)
        at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:292)
        at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3045)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:210)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:241)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:251)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:259)
        at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:855)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:122)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:163)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
        at repast.simphony.relogo.ide.handlers.ContextAndDisplayUtilsGroovy.checkToModifyContextFile(ContextAndDisplayUtilsGroovy.groovy:38)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder$FullBuildInstrumentationInformationVisitor.checkContextAndDisplayFiles(ReLogoBuilder.java:748)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder$FullBuildInstrumentationInformationVisitor.visit(ReLogoBuilder.java:627)
        at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:126)
        at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:85)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:95)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:124)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:108)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.fullBuild(ReLogoBuilder.java:185)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.incrementalBuild(ReLogoBuilder.java:176)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.build(ReLogoBuilder.java:159)
        at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:733)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
        at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
        at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
        at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
        at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
        at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.ILibrary cannot be found by org.eclipse.equinox.registry_3.5.301.v20130717-1549
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 62 more


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: java.lang.ClassNotFoundException: org.eclipse.core.runtime.ILibrary cannot be found by org.eclipse.equinox.registry_3.5.301.v20130717-1549

Andy Clement
Hi Jonathan,

I saw your post on the mailing list so it did get through. Just to mention we are probably spending more time on Stack Overflow these days - it'll more quickly catch someones eye if posted over there.

With the upgrade to the new snapshot are you also now building with groovy 2.3? I suspect you are as I see SAM related methods in there. Did you try compiling (and running with) groovy 2.2 instead? I'm just trying to discern the difference between what you had working and what you are doing now. Really nothing in compilation should leave behind any problems that affect you at runtime.

I suppose it is feasible that some new code added to groovy for 2.3 (java8) is not doing the right thing in terms of class loaders. They may not have picked it up in groovy because they aren't running test code in an OSGi environment.


cheers,
Andy



On 24 June 2014 08:54, Jonathan Ozik <[hidden email]> wrote:
Hello all,

I've been trying to update to the snapshot Groovy Eclipse plugin on Kepler (http://dist.springsource.org/snapshot/GRECLIPSE/e4.3/) but I'm seeing that some plugins that we've developed that were previously working are experiencing what looks like classloading issues. I've included a typical stack trace below. The gist is that elements from the eclipse-core plugin are not being found once Groovy code is executed within our plugin despite the fact that the plugin does declare a dependency on eclipse-core. Like I mentioned, none of these issues exist with the current release build. Could this be an issue related to some custom class loading being done in Groovy?

Any help on this would be greatly appreciated,

Jonathan

java.lang.NoClassDefFoundError: [Lorg/eclipse/core/runtime/ILibrary;
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
        at java.lang.Class.privateGetPublicMethods(Class.java:2651)
        at java.lang.Class.getMethods(Class.java:1467)
        at org.codehaus.groovy.reflection.stdclasses.CachedSAMClass.getSAMMethod(CachedSAMClass.java:160)
        at org.codehaus.groovy.reflection.ClassInfo.isSAM(ClassInfo.java:323)
        at org.codehaus.groovy.reflection.ClassInfo.createCachedClass(ClassInfo.java:313)
        at org.codehaus.groovy.reflection.ClassInfo.access$400(ClassInfo.java:37)
        at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:484)
        at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:475)
        at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
        at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
        at org.codehaus.groovy.reflection.ClassInfo.getCachedClass(ClassInfo.java:94)
        at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:107)
        at org.codehaus.groovy.reflection.ParameterTypes.getParametersTypes0(ParameterTypes.java:78)
        at org.codehaus.groovy.reflection.ParameterTypes.getParameterTypes(ParameterTypes.java:64)
        at org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.isMatchingMethod(MetaMethodIndex.java:450)
        at org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.addMethodToList(MetaMethodIndex.java:375)
        at groovy.lang.MetaClassImpl.addMetaMethodToIndex(MetaClassImpl.java:2742)
        at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java:317)
        at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:292)
        at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3045)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:210)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:241)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:251)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:259)
        at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:855)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:122)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:163)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
        at repast.simphony.relogo.ide.handlers.ContextAndDisplayUtilsGroovy.checkToModifyContextFile(ContextAndDisplayUtilsGroovy.groovy:38)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder$FullBuildInstrumentationInformationVisitor.checkContextAndDisplayFiles(ReLogoBuilder.java:748)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder$FullBuildInstrumentationInformationVisitor.visit(ReLogoBuilder.java:627)
        at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:126)
        at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:85)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:95)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:124)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:108)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.fullBuild(ReLogoBuilder.java:185)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.incrementalBuild(ReLogoBuilder.java:176)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.build(ReLogoBuilder.java:159)
        at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:733)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
        at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
        at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
        at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
        at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
        at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.ILibrary cannot be found by org.eclipse.equinox.registry_3.5.301.v20130717-1549
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 62 more


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: java.lang.ClassNotFoundException: org.eclipse.core.runtime.ILibrary cannot be found by org.eclipse.equinox.registry_3.5.301.v20130717-1549

Jonathan Ozik
Andy,

Thanks for the response. It appears that both Groovy 2.2 and 2.3 result in these types of errors while the Groovy 2.1 compiler does not. The plugin itself is compiled with Groovy 2.1.5 (from the latest release Groovy Eclipse plugin). Looking further, it looks like the groovy-eclipse.jar within the org.codehaus.groovy_2.3.3.xx-201406232311-e43 and org.codehaus.groovy_2.1.8.xx-201406232311-e43 plugins (in eclipse/plugins) are different. Might there be something there that's leading to this different behavior?

Jonathan

On Jun 24, 2014, at 4:34 PM, Andy Clement <[hidden email]> wrote:

Hi Jonathan,

I saw your post on the mailing list so it did get through. Just to mention we are probably spending more time on Stack Overflow these days - it'll more quickly catch someones eye if posted over there.

With the upgrade to the new snapshot are you also now building with groovy 2.3? I suspect you are as I see SAM related methods in there. Did you try compiling (and running with) groovy 2.2 instead? I'm just trying to discern the difference between what you had working and what you are doing now. Really nothing in compilation should leave behind any problems that affect you at runtime.

I suppose it is feasible that some new code added to groovy for 2.3 (java8) is not doing the right thing in terms of class loaders. They may not have picked it up in groovy because they aren't running test code in an OSGi environment.


cheers,
Andy



On 24 June 2014 08:54, Jonathan Ozik <[hidden email]> wrote:
Hello all,

I've been trying to update to the snapshot Groovy Eclipse plugin on Kepler (http://dist.springsource.org/snapshot/GRECLIPSE/e4.3/) but I'm seeing that some plugins that we've developed that were previously working are experiencing what looks like classloading issues. I've included a typical stack trace below. The gist is that elements from the eclipse-core plugin are not being found once Groovy code is executed within our plugin despite the fact that the plugin does declare a dependency on eclipse-core. Like I mentioned, none of these issues exist with the current release build. Could this be an issue related to some custom class loading being done in Groovy?

Any help on this would be greatly appreciated,

Jonathan

java.lang.NoClassDefFoundError: [Lorg/eclipse/core/runtime/ILibrary;
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
        at java.lang.Class.privateGetPublicMethods(Class.java:2651)
        at java.lang.Class.getMethods(Class.java:1467)
        at org.codehaus.groovy.reflection.stdclasses.CachedSAMClass.getSAMMethod(CachedSAMClass.java:160)
        at org.codehaus.groovy.reflection.ClassInfo.isSAM(ClassInfo.java:323)
        at org.codehaus.groovy.reflection.ClassInfo.createCachedClass(ClassInfo.java:313)
        at org.codehaus.groovy.reflection.ClassInfo.access$400(ClassInfo.java:37)
        at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:484)
        at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:475)
        at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
        at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
        at org.codehaus.groovy.reflection.ClassInfo.getCachedClass(ClassInfo.java:94)
        at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:107)
        at org.codehaus.groovy.reflection.ParameterTypes.getParametersTypes0(ParameterTypes.java:78)
        at org.codehaus.groovy.reflection.ParameterTypes.getParameterTypes(ParameterTypes.java:64)
        at org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.isMatchingMethod(MetaMethodIndex.java:450)
        at org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.addMethodToList(MetaMethodIndex.java:375)
        at groovy.lang.MetaClassImpl.addMetaMethodToIndex(MetaClassImpl.java:2742)
        at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java:317)
        at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:292)
        at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3045)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:210)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:241)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:251)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:259)
        at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:855)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:122)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:163)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
        at repast.simphony.relogo.ide.handlers.ContextAndDisplayUtilsGroovy.checkToModifyContextFile(ContextAndDisplayUtilsGroovy.groovy:38)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder$FullBuildInstrumentationInformationVisitor.checkContextAndDisplayFiles(ReLogoBuilder.java:748)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder$FullBuildInstrumentationInformationVisitor.visit(ReLogoBuilder.java:627)
        at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:126)
        at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:85)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:95)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:124)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:108)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.fullBuild(ReLogoBuilder.java:185)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.incrementalBuild(ReLogoBuilder.java:176)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.build(ReLogoBuilder.java:159)
        at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:733)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
        at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
        at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
        at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
        at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
        at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.ILibrary cannot be found by org.eclipse.equinox.registry_3.5.301.v20130717-1549
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 62 more


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: java.lang.ClassNotFoundException: org.eclipse.core.runtime.ILibrary cannot be found by org.eclipse.equinox.registry_3.5.301.v20130717-1549

Jonathan Ozik
Looking further, it does appear like the "isSAM(Class)" call from org.codehaus.groovy.reflection.ClassInfo.createCachedClass is the difference between Groovy 2.2+ and Groovy 2.1, and where the class not found exception is being triggered. I'm afraid that I'm not sure why the class information look up would not be able to find eclipse core classes though… 

Jonathan

On Jun 25, 2014, at 11:13 AM, Jonathan Ozik <[hidden email]> wrote:

Andy,

Thanks for the response. It appears that both Groovy 2.2 and 2.3 result in these types of errors while the Groovy 2.1 compiler does not. The plugin itself is compiled with Groovy 2.1.5 (from the latest release Groovy Eclipse plugin). Looking further, it looks like the groovy-eclipse.jar within the org.codehaus.groovy_2.3.3.xx-201406232311-e43 and org.codehaus.groovy_2.1.8.xx-201406232311-e43 plugins (in eclipse/plugins) are different. Might there be something there that's leading to this different behavior?

Jonathan

On Jun 24, 2014, at 4:34 PM, Andy Clement <[hidden email]> wrote:

Hi Jonathan,

I saw your post on the mailing list so it did get through. Just to mention we are probably spending more time on Stack Overflow these days - it'll more quickly catch someones eye if posted over there.

With the upgrade to the new snapshot are you also now building with groovy 2.3? I suspect you are as I see SAM related methods in there. Did you try compiling (and running with) groovy 2.2 instead? I'm just trying to discern the difference between what you had working and what you are doing now. Really nothing in compilation should leave behind any problems that affect you at runtime.

I suppose it is feasible that some new code added to groovy for 2.3 (java8) is not doing the right thing in terms of class loaders. They may not have picked it up in groovy because they aren't running test code in an OSGi environment.


cheers,
Andy



On 24 June 2014 08:54, Jonathan Ozik <[hidden email]> wrote:
Hello all,

I've been trying to update to the snapshot Groovy Eclipse plugin on Kepler (http://dist.springsource.org/snapshot/GRECLIPSE/e4.3/) but I'm seeing that some plugins that we've developed that were previously working are experiencing what looks like classloading issues. I've included a typical stack trace below. The gist is that elements from the eclipse-core plugin are not being found once Groovy code is executed within our plugin despite the fact that the plugin does declare a dependency on eclipse-core. Like I mentioned, none of these issues exist with the current release build. Could this be an issue related to some custom class loading being done in Groovy?

Any help on this would be greatly appreciated,

Jonathan

java.lang.NoClassDefFoundError: [Lorg/eclipse/core/runtime/ILibrary;
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
        at java.lang.Class.privateGetPublicMethods(Class.java:2651)
        at java.lang.Class.getMethods(Class.java:1467)
        at org.codehaus.groovy.reflection.stdclasses.CachedSAMClass.getSAMMethod(CachedSAMClass.java:160)
        at org.codehaus.groovy.reflection.ClassInfo.isSAM(ClassInfo.java:323)
        at org.codehaus.groovy.reflection.ClassInfo.createCachedClass(ClassInfo.java:313)
        at org.codehaus.groovy.reflection.ClassInfo.access$400(ClassInfo.java:37)
        at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:484)
        at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:475)
        at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
        at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
        at org.codehaus.groovy.reflection.ClassInfo.getCachedClass(ClassInfo.java:94)
        at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:107)
        at org.codehaus.groovy.reflection.ParameterTypes.getParametersTypes0(ParameterTypes.java:78)
        at org.codehaus.groovy.reflection.ParameterTypes.getParameterTypes(ParameterTypes.java:64)
        at org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.isMatchingMethod(MetaMethodIndex.java:450)
        at org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.addMethodToList(MetaMethodIndex.java:375)
        at groovy.lang.MetaClassImpl.addMetaMethodToIndex(MetaClassImpl.java:2742)
        at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java:317)
        at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:292)
        at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3045)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:210)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:241)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:251)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:259)
        at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:855)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:122)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:163)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
        at repast.simphony.relogo.ide.handlers.ContextAndDisplayUtilsGroovy.checkToModifyContextFile(ContextAndDisplayUtilsGroovy.groovy:38)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder$FullBuildInstrumentationInformationVisitor.checkContextAndDisplayFiles(ReLogoBuilder.java:748)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder$FullBuildInstrumentationInformationVisitor.visit(ReLogoBuilder.java:627)
        at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:126)
        at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:85)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:95)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:124)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:108)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.fullBuild(ReLogoBuilder.java:185)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.incrementalBuild(ReLogoBuilder.java:176)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.build(ReLogoBuilder.java:159)
        at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:733)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
        at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
        at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
        at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
        at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
        at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.ILibrary cannot be found by org.eclipse.equinox.registry_3.5.301.v20130717-1549
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 62 more


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





Reply | Threaded
Open this post in threaded view
|

Re: java.lang.ClassNotFoundException: org.eclipse.core.runtime.ILibrary cannot be found by org.eclipse.equinox.registry_3.5.301.v20130717-1549

Andy Clement
The groovy-eclipse jar is going to be different between those two levels (we patch the 2.3 compiler in different ways to the 2.1 compiler). Given that the contents of this jar should only be involved in compilation I don't see how it would impact the runtime.

I imagine it is a rogue Class.forName that perhaps doesn't specify what class loader to use, so it uses the one that loaded the 'current class' where the current class will be some infrastructure class - that loader will only see things in the same loader or above it, not in the apps context. Currently my suspicions are on ParameterTypes which seems to call Class.forName() like that. I will send you a patched version of that groovy class to try, but I am just guessing really... it seems to be an issue with groovy in an OSGi context rather than groovy-eclipse.

cheers,
Andy


On 25 June 2014 10:53, Jonathan Ozik <[hidden email]> wrote:
Looking further, it does appear like the "isSAM(Class)" call from org.codehaus.groovy.reflection.ClassInfo.createCachedClass is the difference between Groovy 2.2+ and Groovy 2.1, and where the class not found exception is being triggered. I'm afraid that I'm not sure why the class information look up would not be able to find eclipse core classes though… 

Jonathan

On Jun 25, 2014, at 11:13 AM, Jonathan Ozik <[hidden email]> wrote:

Andy,

Thanks for the response. It appears that both Groovy 2.2 and 2.3 result in these types of errors while the Groovy 2.1 compiler does not. The plugin itself is compiled with Groovy 2.1.5 (from the latest release Groovy Eclipse plugin). Looking further, it looks like the groovy-eclipse.jar within the org.codehaus.groovy_2.3.3.xx-201406232311-e43 and org.codehaus.groovy_2.1.8.xx-201406232311-e43 plugins (in eclipse/plugins) are different. Might there be something there that's leading to this different behavior?

Jonathan

On Jun 24, 2014, at 4:34 PM, Andy Clement <[hidden email]> wrote:

Hi Jonathan,

I saw your post on the mailing list so it did get through. Just to mention we are probably spending more time on Stack Overflow these days - it'll more quickly catch someones eye if posted over there.

With the upgrade to the new snapshot are you also now building with groovy 2.3? I suspect you are as I see SAM related methods in there. Did you try compiling (and running with) groovy 2.2 instead? I'm just trying to discern the difference between what you had working and what you are doing now. Really nothing in compilation should leave behind any problems that affect you at runtime.

I suppose it is feasible that some new code added to groovy for 2.3 (java8) is not doing the right thing in terms of class loaders. They may not have picked it up in groovy because they aren't running test code in an OSGi environment.


cheers,
Andy



On 24 June 2014 08:54, Jonathan Ozik <[hidden email]> wrote:
Hello all,

I've been trying to update to the snapshot Groovy Eclipse plugin on Kepler (http://dist.springsource.org/snapshot/GRECLIPSE/e4.3/) but I'm seeing that some plugins that we've developed that were previously working are experiencing what looks like classloading issues. I've included a typical stack trace below. The gist is that elements from the eclipse-core plugin are not being found once Groovy code is executed within our plugin despite the fact that the plugin does declare a dependency on eclipse-core. Like I mentioned, none of these issues exist with the current release build. Could this be an issue related to some custom class loading being done in Groovy?

Any help on this would be greatly appreciated,

Jonathan

java.lang.NoClassDefFoundError: [Lorg/eclipse/core/runtime/ILibrary;
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
        at java.lang.Class.privateGetPublicMethods(Class.java:2651)
        at java.lang.Class.getMethods(Class.java:1467)
        at org.codehaus.groovy.reflection.stdclasses.CachedSAMClass.getSAMMethod(CachedSAMClass.java:160)
        at org.codehaus.groovy.reflection.ClassInfo.isSAM(ClassInfo.java:323)
        at org.codehaus.groovy.reflection.ClassInfo.createCachedClass(ClassInfo.java:313)
        at org.codehaus.groovy.reflection.ClassInfo.access$400(ClassInfo.java:37)
        at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:484)
        at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:475)
        at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
        at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
        at org.codehaus.groovy.reflection.ClassInfo.getCachedClass(ClassInfo.java:94)
        at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:107)
        at org.codehaus.groovy.reflection.ParameterTypes.getParametersTypes0(ParameterTypes.java:78)
        at org.codehaus.groovy.reflection.ParameterTypes.getParameterTypes(ParameterTypes.java:64)
        at org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.isMatchingMethod(MetaMethodIndex.java:450)
        at org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.addMethodToList(MetaMethodIndex.java:375)
        at groovy.lang.MetaClassImpl.addMetaMethodToIndex(MetaClassImpl.java:2742)
        at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java:317)
        at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:292)
        at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3045)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:210)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:241)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:251)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:259)
        at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:855)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:122)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:163)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
        at repast.simphony.relogo.ide.handlers.ContextAndDisplayUtilsGroovy.checkToModifyContextFile(ContextAndDisplayUtilsGroovy.groovy:38)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder$FullBuildInstrumentationInformationVisitor.checkContextAndDisplayFiles(ReLogoBuilder.java:748)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder$FullBuildInstrumentationInformationVisitor.visit(ReLogoBuilder.java:627)
        at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:126)
        at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:85)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
        at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:95)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:124)
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:108)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.fullBuild(ReLogoBuilder.java:185)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.incrementalBuild(ReLogoBuilder.java:176)
        at repast.simphony.relogo.ide.handlers.ReLogoBuilder.build(ReLogoBuilder.java:159)
        at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:733)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
        at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
        at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
        at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
        at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
        at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.ILibrary cannot be found by org.eclipse.equinox.registry_3.5.301.v20130717-1549
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 62 more


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email