Tuesday, September 13, 2011

flexjson, eclipse RCP, ClassLoader and Eclipse-BuddyPolicy

I'm developing an RCP application based on rabbitmq-JSON. To deal with JSON I'm using flexjson (I will try latter Jackson...).
This post is dedicated this encountered problem :
  • Plugin A : containing flexjson and the whole technical stack (spring-rabbit, etc....)
  • Plugin B : containing service contract  : Interfaces, response object and in other jars services implementations.
  • B have a dependency on Plugin A
  • When trying to deserialize a response object from within  B I have :

flexjson.JSONException: [  ]:  Could not load fr.frk.Service01Response

My interpretation is :
  • This is flexJson who does the Service01Response instantiation. And plugin A does not know nothing about plugin B...
  • This is a class (OSGI) loading problem.
To solve this I've found to useful  links :
So I finally does  :
  • in plugin A I've declared : 
Eclipse-BuddyPolicy: registered
  • in plugin B  I've declared : 
Eclipse-RegisterBuddy: pluginA

No comments:

Post a Comment