Build Windows RCP Application on Unix Machine
We're trying to do an Eclipse PDE build for a RCP Application via Hudson/Jenkins. We were doing this so far successfully on a Windows machine (Hudson running on Windows Server 2003). We have decided to move our CI system to a unix machine. When executing the same build on the unix machine our build fails with the following error:
!SESSION 2011-04-12 01:00:49.497 ----------------------------------------------- eclipse.buildId=unknown java.version=1.6.0_23 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=sparc, WS=win32, NL=en_US Framework arguments: -application org.eclipse.ant.core.antRunner -buildfile /appl/midw/jenkins/jobs/AP_NAPF/workspace/TP/plugins/org.eclipse.pde.build_3.4.1.R34x_v20081217/scripts/build.xml main -Ddummy=true Command-line arguments: -ws win32 -os win32 -application org.eclipse.ant.core.antRunner -buildfile /appl/midw/jenkins/jobs/AP_NAPF/workspace/TP/plugins/org.eclipse.pde.build_3.4.1.R34x_v20081217/scripts/build.xml main -data /appl/midw/jenkins/jobs/AP_NAPF/workspace/ap_build/workspace -Ddummy=true !ENTRY org.eclipse.osgi 4 0 2011-04-12 01:00:58.961 !MESSAGE An error occurred while automatically activating bundle org.eclipse.ui.workbench (687). !STACK 0 org.osgi.framework.BundleException: The activator org.eclipse.ui.internal.WorkbenchPlugin for bundle org.eclipse.ui.workbench is invalid at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:146) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:980) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:265) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400) at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:427) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:193) at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:370) at org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java:33) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:443) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:165) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:554) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:524) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:455) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:443) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:423) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:193) at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:370) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:446) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:315) at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost开发者_Go百科.java:227) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:139) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:980) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:265) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400) at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:234) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1274) at org.eclipse.ant.core.AntCorePreferences$WrappedClassLoader.findClass(AntCorePreferences.java:115) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at org.eclipse.ant.internal.core.AntClassLoader.loadClassPlugins(AntClassLoader.java:69) at org.eclipse.ant.internal.core.AntClassLoader.findClass(AntClassLoader.java:47) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at org.eclipse.ant.core.AntRunner.run(AntRunner.java:510) at org.eclipse.ant.core.AntRunner.start(AntRunner.java:600) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 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.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) at org.eclipse.equinox.launcher.Main.main(Main.java:1212) Caused by: java.lang.NoClassDefFoundError: org/eclipse/swt/SWTError at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at java.lang.Class.getConstructor0(Class.java:2699) at java.lang.Class.newInstance0(Class.java:326) at java.lang.Class.newInstance(Class.java:308) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:141) ... 61 more Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.SWTError at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:483) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 67 more Root exception: java.lang.NoClassDefFoundError: org/eclipse/swt/SWTError
I've already tried a couple of things after moving to the new infrastructure, with no avail:
- Use a different rt.jar (one coming from a windows JRE) for the PDE build using the
bootclasspath
property. - Changning the
-os
command line argument to:solaris
Is it at all possible to do a RCP build for a Windows application on a Unix machine? If yes, is it necessary to change any parameters when launching the PDE build?
Note: We're using pluginbuilder to setup the PDE build.
The Eclipse you are using to execute the PDE build (i.e. the org.eclipse.ant.core.antRunner application) must be executable in your build server environment. You said that you are executing the build on a Unix machine, but the ws and os parameters are set to win32. So it seems that you use a Windows version of Eclipse on your Unix build server. This can't work since the Unix-specific fragments usually are not available there (needed for example for SWT, that's why the class SWTError is not found).
You should download an Eclipse from eclipse.org which is specific to your environment on your build server (OS, windowing system and processor architecture) and use it to run the PDE build.
Download eclipse delta pack, unzip it into your target eclipse before starting PDE build.
You need to separate the eclipse that you are using to do the build from the eclipse install that you are putting together with your build. The first one needs to be correct for your build OS. Take a look at your PDE Build invocation. There are separate parameters for Eclipse install and target platform.
精彩评论