|Re: [ecf-dev] Datashare channels...|
Hi Remy, Remy Chi Jian Suen wrote:
On Sun, Mar 22, 2009 at 1:18 PM, Scott Lewis <slewis@xxxxxxxxxxxxxxxxx> wrote:The channelIDs have to match.Thanks. I've hacked on the implementation with that in mind and after fighting with serialization, sockets, and NIO for the past couple of days, I've gotten close to a half-working and ugly blob but am now hit with a class loading problem (at least, I think it's a class loading problem anyway). There is a bundle A with container and datashare implementations along with ID and namespace definition and implementations. Then there's an external bundle B that interfaces with ECF APIs directly and sends messages around with the IChannel. I can send messages using TestID (although of course, bundle B only knows them as ID), but when I receive a response and try to deserialize them in bundle B's code, I get a CNFE out of it. java.lang.ClassNotFoundException: TestID 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:88) 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:247) at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) It works if I add bundle A to bundle B's list of Require-Bundle but I sure don't want to do that as that would remove the point of interfacing with the ECF interfaces. Anyone got any tips?
1) Use Buddy Classloading (with appropriate one...e.g. dependents, etc). 2) Use OSGi's Dynamic-ImportPackage (with wildcard I expect) In bundle B.So what are you using to implement datashare in this case? Is it nio? Note that we've already got a signs of life provider based upon CDO (which is in in turn based upon nio)...but the more the merrier, of course.
Back to the top