The issue appears to be that Equinox handles the following situation
differently. It sounds like it is a bug?
We are installing Groovy 2.3.4 as a bundle and it is used by other bundles
including bundle A. Another bundle (bundle B) happens to be embedding
2.3.6 of the Groovy jar file, but it does not export the packages, so it
should not conflict with the use of 2.3.4 by the other bundles.
With Felix, it works fine. With Equinox, we get an error when bundle A is
starting. The exception is:
org.osgi.service.blueprint.container.ComponentDefinitionException:
org.osgi.service.blueprint.container.ComponentDefinitionException: Error
when instantiating bean BeanImpl of class com.company.ControllerService
...
Caused by:
org.osgi.service.blueprint.container.ComponentDefinitionException: Error
when instantiating bean BeanImpl of class com.company.ControllerService
...
Caused by: java.lang.ExceptionInInitializerError
at
org.codehaus.groovy.reflection.ClassInfo.isValidWeakMetaClass(ClassInfo.java:221)
at
org.codehaus.groovy.reflection.ClassInfo.getMetaClassForClass(ClassInfo.java:191)
at
org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:236)
...
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions.
Module [groovy-all is loaded in version 2.3.4 and you are trying to load
version 2.3.6
at
org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$DefaultModuleListener.onModule(MetaClassRegistryImpl.java:509)
at
org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:77)
...
So bundle A is somehow finding the unexported Groovy classes from bundle B
when Equinox is used, but works fine and as expected when Felix is used.
Yes, we should and will fix the issue with different versions and the
unnecessary embedding in bundle B, but it isn't terribly reassuring to see
what seems like a standard OSGi separation of class loading issue when
Equinox is used. Or am I missing something?
On Fri, Dec 5, 2014 at 10:16 AM, asookazian2 <[email protected]> wrote:
> We are seeing a couple of groovy related exceptions when switching to
> equinox
> with 3.0.2 Karaf. Any known issues to expect or why is this happening?
> Everything is fine when using same bundles/features with felix and 3.0.2
> Karaf.
>
> list | grep -i groovy
> 228 | Active | 80 | 2.3.4 | Groovy Runtime
>
> system:framework
> Current OSGi framework is equinox
>
> 1) Caused by: java.lang.NoClassDefFoundError: Could not initialize class
> groovy.lang.GroovySystem
>
> 2) Caused by: groovy.lang.GroovyRuntimeException: Conflicting module
> versions. Module [groovy-all is loaded in version 2.3.4 and you are trying
> to load version 2.3.6
> at
>
> org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$DefaultModuleListener.onModule(MetaClassRegistryImpl.java:509)
> at
>
> org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:77)
> at
>
> org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromMetaInf(ExtensionModuleScanner.java:71)
> at
>
> org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModules(ExtensionModuleScanner.java:53)
> at
>
> org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:110)
> at
>
> org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:71)
> at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:33)
> ... 83 more
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Groovy-related-exceptions-when-switching-to-Equinox-tp4037006.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>