将Eclipse插件放在System类路径上

时间:2009-10-20 15:24:55

标签: serialization eclipse-plugin classpath osgi

我正在尝试对位于插件C中的类型A的对象进行去序列化。

虽然我的插件对插件C具有适当的依赖性,插件C具有类型A,并且还可以创建并实例化类型A的对象,但是当我尝试对A类型的对象进行析构化时,它会失败。

我相信的原因是实际进行反序列化的java.io. *类无法看到类型A.

我需要在插件C的清单中添加什么才能使系统类看到类型A?

这是我得到的堆栈跟踪 -

  

java.lang.ClassNotFoundException:com.chronon.sb.debug.model.TimeAndEventData   在org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:494)   在org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:410)   在org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:398)   在org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:105)   at java.lang.ClassLoader.loadClass(Unknown Source)   at java.lang.ClassLoader.loadClassInternal(Unknown Source)   at java.lang.Class.forName0(Native Method)   at java.lang.Class.forName(Unknown Source)   at java.io.ObjectInputStream.resolveClass(Unknown Source)   at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)   at java.io.ObjectInputStream.readClassDesc(Unknown Source)   at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)   at java.io.ObjectInputStream.readObject0(Unknown Source)   at java.io.ObjectInputStream.readObject(Unknown Source)   at com.chronon.sb.recorder.commons.CompressorUtil.decompressObj ect(CompressorUtil.java:53)   在com.chronon.sb.recorder.commons.CompressorUtil.decompressObj(CompressorUtil.java:36)   在com.chronon.sb.debug.core.dbManagers.Events.createBlock(甚至ts.java:134)   在com.chronon.sb.debug.core.dbManagers.Events.getThreadForTime(Events.java:108)   在com.chronon.sb.debug.core.helpers.MethodCallHelper。(MethodCallHelper.java:62)   在com.chronon.sb.debug.core.helpers.MiscHelper.getVeryFirstMet hod(MiscHelper.java:22)   在com.placid.sb.browser.ui.startbrowse.StartBrowseJob $ 1.run(St artBrowseJob.java:86)   在org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)   在org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:134)   在org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3855)   在org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3476)   在org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)   在org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)   在org.eclipse.ui.internal.Workbench.access $ 4(Workbench.java:22 21)   在org.eclipse.ui.internal.Workbench $ 5.run(Workbench.java:500)   在org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)   在org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)   在org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)   在org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)   在org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)   在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)   在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)   在org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)   在org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)   at java.lang.reflect.Method.invoke(Unknown Source)   在org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)   在org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)   在org.eclipse.equinox.launcher.Main.run(Main.java:1311)   在org.eclipse.equinox.launcher.Main.main(Main.java:1287)

1 个答案:

答案 0 :(得分:1)

阅读好友类加载器(一些更详细的信息是here,尤其是关于内置好友策略的部分。)

简短的回答是:你需要一个MANIFEST条目

 Eclipse-BuddyPolicy: boot