Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] trouble creating proxy, when my service interface is in a distinct bundle

Hi David,

I will take a look at your code over the next few days to try to figure out what's going on, and what can be done to have the proxy class load properly.

Just to let you know...ECF 3.0 and 3.1 was using the RFC119 draft spec for remote services...and now we have shifted over to implementing the final version (now called 'remote services'/chap 13 in the OSGi 4.2 compendium). This code has not been released yet, but I personally have been working on it over the past few weeks and it's approaching completion. The proxy creation in this code is slightly different than that in the ECF 3.1 things might be different with the new code. One nice thing...the ECF remote services API hasn't changed at if that's what you have been using (it sounds like it), then your code won't change.

Just for my the intended purpose of the ecfService extension point just to make it easier to create a container instance and register a remote service?



David Donohue wrote:
An update.  My change (to put the service interface into a bundle
fragment) fixed the problem that the service interface was invisible
when creating the container.  However, this approach has the problem
inherent in bundle fragments: that the interface is visible only to
the fragment host.  So I cannot use this fragment approach.  So I am
again stuck.

Unless I am doing something wrong, I seem to have no option but
include the service interface in my service client bundle, which would
eliminate the usefulness of an "ecfService" extension point.

On Mon, Dec 28, 2009 at 6:58 AM, David Donohue <dd@xxxxxxxxxxxxxxxx> wrote:

Some background:
In integrating ECF into my Equinox OSGi/Eclipse RAP application, I
decided to create a couple extension types like the one you described.

This extension tells an application to listen to register
cftcp:// as a container.

This extension registers that the app is to produce a service using
the generic container type, for the IHello service:
So bundles in my app can easily contribute a specification for which
ECF servers to listen for, using which protocols, and which ECF
services they produce or consume.  To consume a service, any bundle in
my app can do this
Servicer servicer = Servicer.getInstance();
IHello hello1 = servicer.getServiceObject(IHello.class,
"ecftcp://localhost:3787/server1");"hello1.hello() to hello1 service object returns: " + hello1);

So my setup is a little complex, and that certainly confounds things.
End background.

To answer your questions:

a) What version of Eclipse/Equinox is being used?

b) What version of ECF/remote services is being used  (i.e. the 'new
stuff' your workspace...or some previous version of ECF...i.e. which
I am using what you provided me earlier, 3.1

c) What ECF provider are you using (I assume you are using the ECF generic
client/server provider, but want to verify).
yes, generic client/server

d) Can you describe the case where things *don't* work (i.e. you get the
class not found exception) terms of the bundles and classes?  e.g.
'bundle A' has the service interface class (and what/if any other classes),
'bundle B' has the service implementation class(es), 'bundle C' has the
client application code (and perhaps makes the ECF client container),
'bundle D' has the server...or whatever the bundle/package/class arrangement
looks like for your situation.
I have found lots of cases where things don't work :)
My source is here
So when things were not working:
Bundle had service interface class IHello, and the
implementation class Hello.  [I have since turned off exporting of its
package and placed the interface in the fragment, bundle]
Bundle org.inqle.ecf.client has the client and declares the
"ecfServer" extension point.
Bundle org.inqle.ecf.server has the server
Bundle org.inqle.ecf.common has the "ecfService" plugin type.
When I had the above setup, I experienced the error I reported earlier.
When I moved the IHello and Hello classes into bundle
org.inqle.ecf.client (or into a fragment thereof) then it worked.

I hope this helps.  Sorry to dump so much detail on you!
David Donohue

Back to the top