21 Şubat 2013 Perşembe

Strange ClassNotFoundException's in OSGI-based Application

I am working on a web service which will be deployed on WSO2 ESB. I am packaging three JAR files mainly (one is aar actually). Two web service methods from the service.aar use utils.jar directly and indirectly. Indirect usage ends up with a ClassNotFoundException.


Case 1: Everything fine, when utils.jar used directly.



Case 2: ClassNotFoundException when utils.jar used indirectly.

So, what is the problem?

service-utils.jar contains a package named x.y.z which is exactly same with the package name of MyUtils class (so, it is x.y.z.MyUtils)

I think classloading mechanism expected to load MyUtils class under the x.y.z package of service-utils.jar but it is actually located in the x.y.z package of utils.jar. Renaming one of the packages solved problem.

Hope to helps someone else...

Hiç yorum yok:

WSO2 ESB + ClientAccesPolicy.xml + CrossDomain.xml

ClientAccesPolicy.xml and CrossDomain.xml files have to be found at root of your services Silverlight and Flex clients to be able to acce...