Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gemini-dev] Not recurring exception at runtime

Yes, one of the Spring experts has confirmed that CGLIB is truly optional for Spring and it is needed in the scenario below. So we need to make sure, somehow, that those optional imports are not discarded.


Regards,

Glyn


From: "Glyn Normington" <gnormington@xxxxxxxxxx>
To: "Gemini and sub-projects developer discussions" <gemini-dev@xxxxxxxxxxx>
Sent: Friday, 15 June, 2012 10:17:25 AM
Subject: Re: [gemini-dev] Not recurring exception at runtime

Unfortunately, Spring has a ton of optional dependencies, most of which really are optional. I'll ask my Spring colleagues about net.sf.cglib.* and report back. My guess is that it truly is optional.

Optional dependencies which are available really should be resolved, but Equinox (and probably the OSGi spec) treats optionality in a weak way: e.g. if an optional dependency causes a  uses constraint violation, the resolver is free to drop the dependency in its search for a valid resolution.

We've discussed adding support to OSGi for strong optionality in the past, i.e. if an optional dependency is present and it causes resolution to fail, then fail the overall resolution. This might be needed in the longer term.

Meanwhile, I wonder if there is anything in your setup which is prone to giving uses constraint violations in the area of Spring AOP and cglib. Typical causes would be multiple versions of particular bundles. 

Regards,
Glyn

On 14 Jun 2012, at 19:01, Romain Gilles wrote:

After investigations I definitely bealive that is a optional dependency because it is declared as optional in springframework:

Import-Template:
com.jamonapi.*;version="[2.4.0, 3.0.0)";resolution:=optional,
net.sf.cglib.*;version="[2.1.3, 3.0.0)";resolution:=optional,
org.aopalliance.*;version="[1.0.0, 2.0.0)",

The next time it will occurred in my env I will try a refresh and let you know if you are interested.

Romain

2012/6/14 Glyn Normington <gnormington@xxxxxxxxxx>
Hi Romain

An optional dependency that should be mandatory is a possibility. Compare bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=379384

Regards,
Glyn

On 14 Jun 2012, at 14:09, Romain Gilles wrote:

Hi all,
I have the following exception when I start my karaf server. It is strange; it is not occurred each time.
Did you already see it. It's look like an optional dependency that is not resolved in time...

java.lang.IllegalStateException: Cannot load configuration class: test.MyClass
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:346)[57:org.springframework.context:3.1.1.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:222)[57:org.springframework.context:3.1.1.RELEASE]
    at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:444)[61:org.eclipse.gemini.blueprint.core:1.0.1.M1]
    at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:431)[61:org.eclipse.gemini.blueprint.core:1.0.1.M1]
    at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:362)[61:org.eclipse.gemini.blueprint.core:1.0.1.M1]
    at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:254)[61:org.eclipse.gemini.blueprint.core:1.0.1.M1]
    at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[61:org.eclipse.gemini.blueprint.core:1.0.1.M1]
    at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:220)[61:org.eclipse.gemini.blueprint.core:1.0.1.M1]
    at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:224)[62:org.eclipse.gemini.blueprint.extender:1.0.1.M1]
    at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:177)[62:org.eclipse.gemini.blueprint.extender:1.0.1.M1]
    at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:157)[61:org.eclipse.gemini.blueprint.core:1.0.1.M1]
    at org.eclipse.gemini.blueprint.extender.internal.activator.LifecycleManager$1.run(LifecycleManager.java:222)[62:org.eclipse.gemini.blueprint.extender:1.0.1.M1]
    at java.lang.Thread.run(Thread.java:722)[:1.7.0_03]
Caused by: java.lang.NoClassDefFoundError: net/sf/cglib/proxy/MethodProxy
    at java.lang.Class.getDeclaredMethods0(Native Method)[:1.7.0_03]
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)[:1.7.0_03]
    at java.lang.Class.getDeclaredMethod(Class.java:1952)[:1.7.0_03]
    at net.sf.cglib.proxy.Enhancer.getCallbacksSetter(Enhancer.java:627)
    at net.sf.cglib.proxy.Enhancer.setCallbacksHelper(Enhancer.java:615)
    at net.sf.cglib.proxy.Enhancer.registerStaticCallbacks(Enhancer.java:591)
    at org.springframework.context.annotation.ConfigurationClassEnhancer.createClass(ConfigurationClassEnhancer.java:156)
    at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:109)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:336)
    ... 12 more
Caused by: java.lang.ClassNotFoundException: net.sf.cglib.proxy.MethodProxy
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)[osgi-3.6.2.R36x_v20110210.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)[osgi-3.6.2.R36x_v20110210.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)[osgi-3.6.2.R36x_v20110210.jar:]
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)[osgi-3.6.2.R36x_v20110210.jar:]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_03]
    ... 21 more


Romain
_______________________________________________
gemini-dev mailing list
gemini-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/gemini-dev


_______________________________________________
gemini-dev mailing list
gemini-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/gemini-dev


_______________________________________________
gemini-dev mailing list
gemini-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/gemini-dev


_______________________________________________
gemini-dev mailing list
gemini-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/gemini-dev


Back to the top