Hi,
for me it sounds like the ApplicationContext has been already destroyed,
whereas the Delegator still try to destroy it (that's why you have the
invalid application context).
Actually, we have this issue in Karaf 2.4.x itself around Aries JMX at
shutdown:
https://issues.apache.org/jira/browse/KARAF-3346
I started to work on it yesterday.
In the mean time, I think you can ignore this error in your test: the
test succeeded.
Regards
JB
On 12/12/2014 10:17 AM, Charles Moulliard wrote:
Hi,
I still have a strange error reported by Felix when running pax-exam 4.3
2014-12-12 10:11:24,292 | INFO | FelixStartLevel | core
| 34 - org.apache.aries.jmx.core - 1.1.2 | Unregistering
MBean with ObjectName
[osgi.compendium:service=cm,version=1.3,framework=org.apache.felix.framework,uuid=c1e77204-f898-47d9-8751-3281b7701cc3]
for service with service.id <http://service.id> [10]
Exception in thread "Thread-41" java.lang.NoClassDefFoundError:
org/springframework/osgi/context/support/AbstractDelegatedExecutionApplicationContext$2
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:210)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$NoDependenciesWaitRefreshExecutor.close(AbstractDelegatedExecutionApplicationContext.java:93)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.doClose(AbstractDelegatedExecutionApplicationContext.java:236)
at
org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:980)
Caused by: java.lang.ClassNotFoundException: Unable to load class
'org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$2'
because the bundle wiring for org.springframework.osgi.core is no longer
valid.
at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1521)
at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77)
at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1993)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 4 more
Here are the Spring bundles being deployed into the karaf container when
pax-exam test ran the test
[ 61] [Active ] [ ] [ ] [ 30] Apache ServiceMix
:: Bundles :: spring-core (3.2.9.RELEASE_1)
[ 62] [Active ] [ ] [ ] [ 30] Apache ServiceMix
:: Bundles :: spring-expression (3.2.9.RELEASE_1)
[ 63] [Active ] [ ] [ ] [ 30] Apache ServiceMix
:: Bundles :: spring-beans (3.2.9.RELEASE_1)
[ 64] [Active ] [ ] [ ] [ 30] Apache ServiceMix
:: Bundles :: spring-aop (3.2.9.RELEASE_1)
[ 65] [Active ] [ ] [ ] [ 30] Apache ServiceMix
:: Bundles :: spring-context (3.2.9.RELEASE_1)
[ 66] [Active ] [ ] [ ] [ 30] Apache ServiceMix
:: Bundles :: spring-context-support (3.2.9.RELEASE_1)
- So why do we still get the error : "Caused by:
java.lang.ClassNotFoundException: Unable to load class
'org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$2'
because the bundle wiring for org.springframework.osgi.core is no longer
valid." ?
- As this ERROR is reported when Felix is shutdown by PAX-EXAM, can I
forget it as the test succeeds ?
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
Regards,
On Thu, Dec 11, 2014 at 6:28 PM, Charles Moulliard <[email protected]
<mailto:[email protected]>> wrote:
You are right. Will change my code.
On Thu, Dec 11, 2014 at 6:20 PM, Jean-Baptiste Onofré
<[email protected] <mailto:[email protected]>> wrote:
You can, but it doesn't make sense as the features.cfg is
already ok.
On 12/11/2014 06:14 PM, Charles Moulliard wrote:
You refer to this code :
https://github.com/apache/__karaf/blob/karaf-2.x/itests/__src/test/java/org/apache/__karaf/itests/__SpringFeaturesTest.java
<https://github.com/apache/karaf/blob/karaf-2.x/itests/src/test/java/org/apache/karaf/itests/SpringFeaturesTest.java>
?
Why can't we use anymore the features(URL, feature, ...)
option of
pax-exam to setup Karaf before to run each uni test ?
On Thu, Dec 11, 2014 at 6:10 PM, Jean-Baptiste Onofré
<[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>> wrote:
Take a look on the Karaf itests: we install all
features in itests,
including spring/spring-dm.
Just one think: spring-dm doesn't work with spring 4.
Regards
JB
On 12/11/2014 06:08 PM, Charles Moulliard wrote:
Does that means that the feature has to be
installed within the unit
test and not anymore when we setup the Karaf
container like here -
https://github.com/____opendaylight/controller/blob/____master/itests/base-features-____it/src/test/java/org/____opendaylight/controller/base/____BaseFeatureTest.java
<https://github.com/__opendaylight/controller/blob/__master/itests/base-features-__it/src/test/java/org/__opendaylight/controller/base/__BaseFeatureTest.java>
<https://github.com/__opendaylight/controller/blob/__master/itests/base-features-__it/src/test/java/org/__opendaylight/controller/base/__BaseFeatureTest.java
<https://github.com/opendaylight/controller/blob/master/itests/base-features-it/src/test/java/org/opendaylight/controller/base/BaseFeatureTest.java>>
with "featuresService.____installFeature("") ?
On Thu, Dec 11, 2014 at 5:57 PM, Jean-Baptiste Onofré
<[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>
<mailto:[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>>> wrote:
You don't have to install the features
repository (it's
already in
the Karaf distro).
Regards
JB
On 12/11/2014 05:52 PM, Charles Moulliard wrote:
Hi,
When I try a pax-exam 4.3 test using Karaf
2.4, I get
this OSGI
Wiring error
2014-12-11 17:43:04,313 | INFO |
FelixStartLevel | core
| 34 -
org.apache.aries.jmx.core - 1.1.2 |
Unregistering
MBean with ObjectName
[osgi.compendium:service=cm,______version=1.3,framework=org.______apache.felix.framework,uuid=______ef339918-f755-402a-955d-______93182f61a4d5]
for service with service.id
<http://service.id> <http://service.id>
<http://service.id>
<http://service.id> [10]
Exception in thread "Thread-41"
java.lang.______NoClassDefFoundError:
org/springframework/osgi/______context/support/______AbstractDelegatedExecutionAppl______icationContext$2
at
org.springframework.osgi.______context.support.______AbstractDelegatedExecutionAppl______icationContext.__normalClose(________AbstractDelegatedExecutionAppl______icationContext.java:210)
at
org.springframework.osgi.______context.support.______AbstractDelegatedExecutionAppl______icationContext$______NoDependenciesWaitRefreshExecu______tor.close(______AbstractDelegatedExecutionAppl______icationContext.java:93)
at
org.springframework.osgi.______context.support.______AbstractDelegatedExecutionAppl______icationContext.doClose(________AbstractDelegatedExecutionAppl______icationContext.java:236)
at
org.springframework.context.______support.______AbstractApplicationContext$1.______run(______AbstractApplicationContext.______java:980)
Caused by:
java.lang.______ClassNotFoundException: Unable
to load class
'org.springframework.osgi.______context.support.______AbstractDelegatedExecutionAppl______icationContext$2'
because the bundle wiring for
org.springframework.osgi.core is
no longer
valid.
at
org.apache.felix.framework.______BundleWiringImpl.______findClassOrResourceByDelegatio______n(BundleWiringImpl.java:____1521)
at
org.apache.felix.framework.______BundleWiringImpl.access$400(______BundleWiringImpl.java:77)
at
org.apache.felix.framework.______BundleWiringImpl$______BundleClassLoader.loadClass(______BundleWiringImpl.java:1993)
at
java.lang.ClassLoader.______loadClass(ClassLoader.java:______358)
... 4 more
Is this error related to the fact that I
try to use
Spring &
Spring-DM
features part of the Karaf assembly project ?
features(
maven().groupId("org.apache.______karaf.assemblies.features").______artifactId("standard").__type("____xml").classifier("__features").______versionAsInProject(),
"spring",
"spring-dm"
),
Regards,
--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :
http://cmoulliard.github.io
<http://cmoulliard.github.io>
--
Jean-Baptiste Onofré
[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>
<mailto:[email protected]
<mailto:[email protected]> <mailto:[email protected]
<mailto:[email protected]>>>
http://blog.nanthrax.net
Talend - http://www.talend.com
--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :
http://cmoulliard.github.io
<http://cmoulliard.github.io>
--
Jean-Baptiste Onofré
[email protected] <mailto:[email protected]>
<mailto:[email protected] <mailto:[email protected]>>
http://blog.nanthrax.net
Talend - http://www.talend.com
--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
<http://cmoulliard.github.io>
--
Jean-Baptiste Onofré
[email protected] <mailto:[email protected]>
http://blog.nanthrax.net
Talend - http://www.talend.com
--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
<http://cmoulliard.github.io>
--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
<http://cmoulliard.github.io>
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com