Re: SDO in Eclipse Plug-in
Tomasz, Sorry for the delay in my reply, I've been extremely busy with work recently. I'd like to suggest that you import your plug-ins into your Eclipse workspace as plug-in projects and run them from there for testing. Then you won't have to copy them to your Eclipse directory every time you make a change and you can take advantage of all the Eclipse PDE Tools. Anyway, on to your problem. You said you saw two new plug-ins, org.apache.tuscany.sdo.lib and org.apache.tuscany.sdo.spec. Are you also seeing impl and tools as available plug-ins? If not, that will be a problem. Also, for the buddy policy to work correctly, the SDO plug-ins need to depend on each other. Here's how my SDO dependencies are set up in my manifests: org.apache.tuscany.sdo.impl depends on org.apache.tuscany.sdo.spec org.apache.tuscany.sdo.lib depends on org.apache.tuscany.sdo.spec org.apache.tuscany.sdo.impl org.apache.tuscany.spec and org.apache.tuscany.tools don't need to depend on the other SDO plug-ins One final note. What version of EMF are you running with? Tuscany officially requires EMF 2.2.3, but it may also work with 2.3 (which comes with Eclipse 3.3). It will NOT work with EMF 2.4, but you probably wouldn't have that unless you're using Eclipse 3.4. I hope some of that helps. Write me back with any more questions and I'll try to be a little more responsive in the future. :-) Regards, Eric Tomasz Klukowski [EMAIL PROTECTED] wrote on 05/20/2008 04:47:51 PM: [image removed] Re: SDO in Eclipse Plug-in Tomasz Klukowski to: tuscany-user 05/20/2008 04:58 PM Please respond to tuscany-user. Eric, As you wrote, I had Tuscany in four .jar (api, impl, lib, tools) files added to my build-path. I appended the line: Eclipse-BuddyPolicy: dependent to the each MANIFEST.MF file, but it did not help very much - earlier my plug-in crashed with java.lang.NoClassDefFoundError: org/apache/tuscany/sdo/api/SDOUtil (...) Caused by: java.lang.ClassNotFoundException: org.apache.tuscany.sdo.api.SDOUtil at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass (BundleLoader.java:402) and now it crashes with java.lang.ExceptionInInitializerError (...) Caused by: java.lang.NullPointerException at org.apache.tuscany.sdo.api.SDOUtil.clinit(SDOUtil.java:48) Then I copied these .jar files to /usr/lib/eclipse/plugins/ and ran eclipse -clean Two new plug-ins were found: org.apache.tuscany.sdo.lib and org.apache.tuscany.sdo.spec. I added them to the required plug-ins, but it did not change anything. What am I doing wrong? below is the fragment of code and the error log: try { scope = SDOUtil.createHelperContext(); } catch (Throwable e) { e.printStackTrace(); } my error log: java.lang.ExceptionInInitializerError at omegaomegavisio.Activator.init(Activator.java:47) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator (AbstractBundle.java:136) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start (BundleContextImpl.java:962) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker (BundleHost.java:317) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start (AbstractBundle.java:256) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:342) at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.preFindLocalClass (EclipseLazyStarter.java:88) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass (ClasspathManager.java:412) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass (DefaultClassLoader.java:189) at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass (BundleLoader.java:334) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass (BundleLoader.java:386) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass (BundleLoader.java:347) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass (DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass (BundleLoader.java:278) at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass (BundleHost.java:227) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass (AbstractBundle.java:1245
Re: SDO in Eclipse Plug-in
Hi Tomasz, What is the SDO version you are using? Have you tried to debug in the SDO source code to check where exactly it stops? Regards, Adriano Crestani On Mon, May 12, 2008 at 1:01 PM, Tomasz Klukowski [EMAIL PROTECTED] wrote: I want to make an Eclipse Plug-in that uses Apache Tuscany SDO library. Unfortunatelly I've come into a severe problem that I can't overcome. I've tried many different things but nothing has worked and I'm very desperete for any help. Here's a description of my problem: At the moment of calling SDOUtil.createHelperContex() the execution of the calling method stops. Nothing happens and no exception is thrown. For example calling of this method causes nothing more than writing look! on the console: void exmp() { System.out.println(look!); SDOUtil.createHelperContext(); System.out.println(I'm on TV!); } A similar problem is with HelperProvider.getDefaultContext(). I suppose the problem is that not all needed libraries are loaded\initialized as I run the project as the Eclipse Plug-in. When I used the SDO-Tuscany in application compiled as the SWT Application everything worked fine! Is there any way to make the SDO-Tuscany library work in an Eclipse Plug-in?
Re: Re: SDO in Eclipse Plug-in
I'm currently using SDO v. 1.1 Fragment of the code of the Plug-in Activator: public Activator() { plugin = this; try { scope = SDOUtil.createHelperContext(); } catch (Throwable e) { e.printStackTrace(); } } And the list of errors shown when I run the Plug-in: java.lang.NoClassDefFoundError: org/apache/tuscany/sdo/api/SDOUtil at omegaomegavisio.Activator.init(Activator.java:47) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:136) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:962) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:317) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:256) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:342) at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.preFindLocalClass(EclipseLazyStarter.java:88) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:412) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189) at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:334) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:386) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:278) at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1245) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:147) at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:759) at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243) at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51) at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:242) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:238) at org.eclipse.ui.internal.registry.ViewDescriptor.createView(ViewDescriptor.java:69) at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:292) at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:197) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566) at org.eclipse.ui.internal.WorkbenchPage$ActivationList.setActive(WorkbenchPage.java:3915) at org.eclipse.ui.internal.WorkbenchPage.restoreState(WorkbenchPage.java:2929) at org.eclipse.ui.internal.WorkbenchWindow.restoreState(WorkbenchWindow.java:1936) at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.java:2873) at org.eclipse.ui.internal.Workbench.access$14(Workbench.java:2821) at org.eclipse.ui.internal.Workbench$19.run(Workbench.java:1697) at org.eclipse.ui.internal.Workbench.runStartupWithProgress(Workbench.java:1437) at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1695) at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1666) at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1545) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1489) at org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(WorkbenchConfigurer.java:183) at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:702) at org.eclipse.ui.internal.Workbench.init(Workbench.java:1101) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1863) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at