Skip to main content



      Home
Home » Eclipse Projects » Virgo » Import packages in spring dependant bundle question
Import packages in spring dependant bundle question [message #908529] Wed, 05 September 2012 10:26 Go to next message
Eclipse UserFriend
Hi,

when importing bundle that has dependency on springframework and hibernate libraries I get java.lang.NoClassDefFoundError org/hibernate/annotations/Entity when spring tries to load class via org.springframework.util.ClassUtils.forName(String name, ClassLoader classLoader) method.

This is because this method is using TCCL that is CL from my bundle and I do not have imported package org.hibernate.annotations in bundle manifest.

This is not happening when classes are loaded in a normal way although packages are not imported in bundle manifest also.

Is this desired behavior?

I would like to avoid very large import packages statement in manifest.

Thanks, Vladimir.
Re: Import packages in spring dependant bundle question [message #911994 is a reply to message #908529] Wed, 12 September 2012 14:42 Go to previous message
Eclipse UserFriend
Hi,

Unfortunately this is just where OSGi classloading clashes with old world classloading. When code uses '.forName' for example using the TCCL then you just have to do the imports on your own bundle. This is not desired behaviour but the only way round the unfriendly classloading in some third party code. You can avoid the large manifest if you really want by boot delegating the packages in the Java profile but be carefully as this may have other side effects especially if other code is also importing the packages.

Chris.
Previous Topic:Virgo packaged Spring 3 bundles not having all dependencies fulfilled
Next Topic:duplicated spring bundles
Goto Forum:
  


Current Time: Tue Jul 01 16:21:35 EDT 2025

Powered by FUDForum. Page generated in 0.23833 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top