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)
>     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
>
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication
> (EclipseAppLauncher.java:92)
>     at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start
> (EclipseAppLauncher.java:68)
>     at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:400)
>     at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:177)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
>     at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
>     at org.eclipse.core.launcher.Main.run(Main.java:977)
>     at org.eclipse.core.launcher.Main.main(Main.java:952)
> Caused by: java.lang.NullPointerException
>     at org.apache.tuscany.sdo.api.SDOUtil.<clinit>(SDOUtil.java:48)
>     ... 66 more
>
>
> Eric S Rose wrote:
> >
> > Tomasz,
> >
> > I ran into the same problem you're having when I tried to create
> > Tuscany Eclipse plug-ins. I'm assuming you have Tuscany in several
> > different plug-ins, like org.apache.tuscany.sdo.api,
> > org.apache.tuscany.sdo.impl, org.apache.tuscany.sdo.lib and
> > org.apache.tuscany.sdo.tools. If that's the way yours are set up,
> > you'll need to make use of Eclipse buddy policy, described in
> > http://www.eclipsezone.com/articles/eclipse-vms/ (look at the
> > ClassLoaders, Bundles and Buddies section). Basically, you need to add
> > Eclipse-BuddyPolicy: dependent to the MANIFEST.MF in the api, impl and
> > lib plug-ins. Then, make whatever plug-in your void exmp() code is in
> > depend on the Tuscany plug-ins and everything should work.
> >
> > Hope that helps,
> >
> > Eric
> >

Reply via email to