Hi,
Let's say SerivceA is in BundleA, ClassB is in BundleB
This problem could be caused by BundleA start before BundleB, so the static Class B not get initialized at all when BundleA starting, this is a timing issue and your logic depend on bundles start sequence isn't a good practice in OSGi world. How you reference ClassB in ServiceA? If you expose object in ClassB as an OSGi service and reference it in ServiceA, then BundleB will always get initialized firstly so you won't see this timing issue.

Freeman



On 2011-5-6, at 上午9:56, [email protected] wrote:

I have a service A instantiated by blueprint. The constructor of service A
has reference to a static object in Class B in a different bundle.
Blueprint kept on giving me java.lang.NoClassDefFoundError and
java.lang.ClassNotFoundException on Class B.

This seems to happen only on the first startup but resolves itself if I restart Karaf. It probably have to do with the fact that I prepare all the
bundles in the deploy directory without defining any feature.

I am running out of idea how to debug this issue.  Your help would be
greatly appreciated.

Regards,

- Triet

--
View this message in context: 
http://karaf.922171.n3.nabble.com/ClassNotFoundException-problem-which-resolved-after-restarting-Karaf-tp2906583p2906583.html
Sent from the Karaf - User mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
Connect at CamelOne May 24-26
The Open Source Integration Conference








Reply via email to