NoClassDefFoundError while accessing a package from an Active bundle
posted 2 years ago
I am referring one package from a bundle (say ABC). I have added that pkg in dependencies(pom.xml) of that bundle. I have also added the package in osgi.bnd of the bundle. Upon building the bundle with mvn - I can see that package in the import list of manifest.mf of the bundle ABC.
When I start the container , I see that bundle ABC becomes active (that means all the dependencies are resolved)- but when I give following command - b <bundle id of ABC> - I dont see that pkg listed in the import list. (Whereas that pkg is present in export list of bunle XYZ - which is exporting it)
In configuration also I have made sure that exporting bundle XYZ has lower start order than dependent bundle ABC (started before the dependent bundle)
BUT , when I uninstall bundle ABC and restart the container - the bundle ABC gets registered in the end of the OSGI modules list and I can see the pkg in the imported list.
In live environment I wont have an option of executing this above manual step (of uninstalling and restarting the container). Whats going wrong in first place I am not able to figure out. Any pointers please?