Latest Activity

An incompatibility between Ganymede and Galileo

Francis Upton's blog - Sun, 11/22/2009 - 19:17

In working on my company’s product I saw that the correct icons were appearing when the product was run in Ganymede, but not Galileo.  The problem is captured in bug 295803 and has to do with the selection of the Navigator Content Extension (NCE) to provide the label when there are two NCEs that operate on the same content.  In my applications case, it was my app’s NCE and the NCE that takes care of resources.  In Ganymede, the higher priority of these NCEs has the first opportunity to provide the labels, but in Galileo, it’s the opposite, the lowest priority provides the labels, which is certainly not what you want.

I think we should address the above bug in 3.5.2, as it’s a bad incompatible change.

Here is the (amazingly pretty and elegant) code that I used to work around the problem:

/* * Yum. Due to Eclipse bug 295803 we need to change the priority of the * NCE for our product. This only needs to happen on a 3.5.0 or 3.5.1 * system. We sense this by the org.eclipse.ui.navigator bundle version * (in which the minor version lags one behind the main Eclipse * version.) Note that if this bug is fixed in 3.5.2, then the version * check needs to consider only CNF versions 3.4.0 and 3.4.1. */ Bundle bundle = Platform.getBundle("org.eclipse.ui.navigator"); //$NON-NLS-1$ Dictionary headers = bundle.getHeaders(); String version = (String)headers.get("Bundle-Version"); //$NON-NLS-1$ if (version.startsWith("3.4")) //$NON-NLS-1$ { INavigatorContentService ncs = getNavigator() .getNavigatorContentService(); NavigatorContentDescriptor desc = (NavigatorContentDescriptor)ncs .getContentDescriptorById("com.oaklandsw.transform.navigatorContent"); //$NON-NLS-1$ try { Field[] fields = desc.getClass().getDeclaredFields(); for (int i = 0; i < fields.length; i++) { if (fields[i].getName().equals("priority")) //$NON-NLS-1$ { fields[i].setAccessible(true); fields[i] .set(desc, new Integer(Priority.LOWEST_PRIORITY_VALUE)); break; } } } catch (Exception e) { Util.impossible(e); } }
Categories: Francis Upton

RCP, p2, Vista and VirtualStore

Francis Upton's blog - Sun, 05/24/2009 - 22:06

I have an RCP application that uses p2 and needs to run on all of our platforms (this uses 3.4.2).  Everything was great until Vista came along.  On Vista when going to the Software Updates… dialog it gets the “not properly configured” dialog and won’t let me do the fun p2 stuff.

The problem is that Vista does not like it (sort of) if you try to write things in the Program Files directory.  You can write as much as you like only during the install process, and there seems to be some way that it writes a “virtual store” into this area when the app is running, but p2 will not work with this.

The solution that I have found is to (my app is called “osdt”, which is also the name of my launcher executable):

  1. Add
    • -Dosgi.configuration.area=@user.home/osdt/configuration

    to my Launching Arguments in my product file in the VM Arguments section for all platforms.  This tells it to look for the configuration area in a location that’s relative to the Java “user.home” system property (c:/Users/<User name> on Vista and c:/Documents and Settings/<User name> on XP.)

  2. Add the following into my config.ini file:
    • osgi.instance.area=@user.home/osdt/workspace
  3. This makes sure that the p2 data area is relative to the configuration and my workspace is also created relative to the user’s home directory.

  4. Teach my installer to put the configuration and p2 directories in the expected location. I use install4j – and the key here is to have it come up with the variable setting the location to install these things at install time using the “user.home” system property from Java so that the Eclipse @user.home and where the kit is being installed to will always be in sync.

All of this was great, but it did not work, and I was finding that no matter what I did to my osdt.ini file it had no effect. The problem was that the Vista “virtual store” mechanism had written my information from the previous installs and that was silently overriding what was in the Program Files folder. In general, if you write something to the Program Files folder, it will really be written to c:/Users/<User name>/AppData/Local/VirtualStore/Program Files, and whatever is at this virtual store location will silently take precedence over what is in the Program Files folder. Once I deleted the stuff in the virtual store location everything was fine.

Categories: Francis Upton

Application “…” could not be found in the registry.

Francis Upton's blog - Wed, 05/20/2009 - 08:04

Just spent a couple of hours debugging one of these and thought I would write it up in hopes that it makes things better.

My use case is that I’m calling my application from an API which means I’m dynamically starting it using the EclipseStarter class (with reflection since I can’t reference Eclipse stuff from the JAR file that my customers use).

Everything used to work in this particular set of tests (don’t they all say that?), and then when I run them I get the error below.

It turns out the problem was the plugin (bundle) that contained the application definition (in the plugin.xml) did not get resolved.  It did not get resolved because it depended on a plugin that did not exist.  However there is nothing in the logs that indicated there was a problem loading this plugin, it was just silently not loaded.  I only discovered this debugging the bundle resolution code and wondering why it was not resolved.

So if you get this error and you can’t think of any other reason for it, make sure all of your dependent bundles are present, and ;resoution=optional could be your friend.

This bug has been filed about this: (this happened in 3.4.2, so maybe it’s fixed in 3.5).

Caused by: java.lang.RuntimeException: Application “com.oaklandsw.transform.runtime.engine” could not be found in the registry. The applications available are:, org.eclipse.update.core.standaloneUpdate, org.eclipse.updat
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.oaklandsw.transform.runtime.RuntimeFactory.createRuntime(
… 76 more

Categories: Francis Upton


Subscribe to Talend Community Coders aggregator