Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] [SHAREDOBJECT] Can't retrieve the object.

Hi Cyril,

I'm very glad that things are working OK for you.

cyril giraudon wrote:
Hi,

I have now exported the package containing my object and all works fine !
I'm a totally newby in Eclipse. And for the moment, I don't exactly what "export" means.

This is part of OSGi, which is underneath Eclipse. If you are interested in the spec, see: http://www.osgi.org/Main/HomePage

And/or look at the materials on the Equinox project (the implementation of the OSGi spec that is in Eclipse): http://www.eclipse.org/equinox/


For instance, what is the relation between the 'export' statement and the error : The object can be retrieved by the manager which shared it but not by another manager ?

The reason for this is as follows:

Each plugin (also called a 'bundle' in OSGi) has it's own, separate classloader. On the *receiver* of the replicate message, the code in bundle org.eclipse.ecf.provider tries to create the shared object replica...but first must load the shared object class(s). To do this it has to find the specified class (i.e. your MySharedObject class). For this class to be found by the classloader for bundle org.eclipse.ecf.provider, it has to be exported via the Export-Package statement in the manifest.mf. If it's not exported, then the classloader that is trying to create the replica of MySharedObject cannot find the MySharedObject class, and the replication fails.

This was one of the sources of the Equinox work on the 'buddy classloader', which allows plugins to have 'buddy' plugins that can supply them with classes (like MySharedObject). See this bug for a bit of the history

https://bugs.eclipse.org/bugs/show_bug.cgi?id=87775



I must tame more Eclipse.

Thanks a lot for you help, I will be able to study in greater depth ECF now.

OK, great!  Thanks.

Scott



Back to the top