Hello Felix,
Thanks very much for your answer. I just read the javadoc of the
PackageAdmin and it seems that it only applies when the bundle exports
packages and it's not the case... Nevertheless I tried to call the
refreshPackages method for the updated bundle and I have the same behavior.
I think I precisely identify where the problem occurs in the code. In
fact we have three main bundles:
- the first one A is the server.
- the second one B is the application that need to be deployed on the
server. The application (and some other hints) are provided through an
OSGi service.
- the third one C is the deployment manager that implement the
whiteboard pattern.
The application registers all resources that it will provide. Something
like that:
register("/path", MyResource.class);
This is done with the application class within bundle C. Both
application and resource are in the same bundle so there is no loading
problem.
When the request is executed for the path, the server tries to determine
which is the appropriate method of the resource for the call. It calls
using reflection the getDeclaredMethods for the resource class. This
class is gotten using the registered application. In this case, I have
an class not found exception for a class that corresponds to the return
type of a method. This exception only occurs when updating bundle B...
Hope I'm clear with my explanations...
Thierry
Hi
Once you updated the bundle other bundles may still be using the old bundle
version. You have to refresh the bundle wirings for them to be wired to the new
bundle.
Traditionally this has been done with a call to
PackageAdmin.refreshBundles(Bundle[]) (There is now new API to do this, but I
do not know it off-hand; but the old is still avaliable).
Regards
Felix
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]