[
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,
Usually, this error is because the bundle that contains the interface
(i.e. org.inqle.qa.common.services.IHello class) is not exporting the
org.inqle.qa.common.services package.
For example, this is from the manifest.mf in the
org.eclipse.ecf.examples.remoteservices.hello bundle:
Export-Package: org.eclipse.ecf.examples.remoteservices.hello,
org.eclipse.ecf.examples.remoteservices.hello.impl
Yours should have something like this in the manifest.mf:
Export-Package: org.inqle.qa.common.services
Only then will the provider's classloader be able to find the class
(using the
Eclipse-BuddyPolicy: global
as you point out).
Thanks,
Scott
David Donohue wrote:
Hello again Scott & friends,
My application was working great until I moved my service interface
into a bundle different from my ECF client activator bundle. Now that
my service (IHello) interface is in a distinct bundle, I get the error
at bottom. I gather that this bundle is having trouble seeing my
IHello interface:
org.eclipse.ecf.provider.remoteservice_3.1.0.v20091012-1618.jar
however I see that the latter bundle has this in MANIFEST.MF:
Eclipse-BuddyPolicy: global
so I would think it should see my service interface.
Here is my code snippet:
IContainerFactory containerFactory = getContainerManagerService()
.getContainerFactory();
containerFactory.createContainer("ecf.generic.client");
ServiceTracker serviceTracker = new ServiceTracker(
bundleContext,
bundleContext.createFilter("(&("
+ org.osgi.framework.Constants.OBJECTCLASS + "="
+ "org.inqle.qa.common.services.IHello" + ")(" +
DistributionConstants.REMOTE + "=*))"),
this);
serviceTracker.open();
Any ideas what I am doing wrong?
Thanks much and happy holidays!
David Donohue
[log;-0500 2009.12.27
08:26:34:340;ERROR;org.eclipse.ecf.osgi.services.distribution;org.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.osgi.services.distribution;code=4;message=org.eclipse.ecf.internal.osgi.services.distribution.DiscoveredServiceTrackerImpl:registerRemoteServiceReferences:Exception
creating or registering remote reference
RemoteServiceReferenceImpl[class=org.inqle.qa.common.services.IHello;registration=RemoteServiceRegistrationImpl[remoteServiceID=org.eclipse.ecf.remoteservice.RemoteServiceID[containerID=StringID[ecftcp://127.0.0.1:3787/server1];containerRelativeID=0];containerID=StringID[ecftcp://127.0.0.1:3787/server1];serviceid=0;serviceranking=0;classes=[org.inqle.qa.common.services.IHello];state=0;properties={ecf.rsvc.id=0,
org.inqle.ecf.server.uri=ecftcp://127.0.0.1:3787/server1}]];severity4;exception=org.eclipse.ecf.core.util.ECFException:
Exception creating proxy for remote service;children=[]]]
org.eclipse.ecf.core.util.ECFException: Exception creating proxy for
remote service
at org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceImpl.getProxy(RemoteServiceImpl.java:85)
at org.eclipse.ecf.internal.osgi.services.distribution.DiscoveredServiceTrackerImpl.registerRemoteServiceReferences(DiscoveredServiceTrackerImpl.java:577)
at org.eclipse.ecf.internal.osgi.services.distribution.DiscoveredServiceTrackerImpl.handleDiscoveredServiceAvailable(DiscoveredServiceTrackerImpl.java:287)
at org.eclipse.ecf.internal.osgi.services.distribution.DiscoveredServiceTrackerImpl.access$3(DiscoveredServiceTrackerImpl.java:226)
at org.eclipse.ecf.internal.osgi.services.distribution.DiscoveredServiceTrackerImpl$1.run(DiscoveredServiceTrackerImpl.java:119)
at org.eclipse.equinox.concurrent.future.SingleOperationFuture$1.run(SingleOperationFuture.java:96)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.equinox.concurrent.future.SingleOperationFuture.runWithProgress(SingleOperationFuture.java:89)
at org.eclipse.equinox.concurrent.future.ThreadsExecutor$1.run(ThreadsExecutor.java:49)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.inqle.qa.common.services.IHello
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:489)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceImpl.getProxy(RemoteServiceImpl.java:80)
... 9 more
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev