Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-update-dev] More problems with DisableCommand et al

I have an application that was running fine on M4, but since the move to M5
has stopped working correctly. Specifically, I was installing a feature
using:

      InstallCommand command = new InstallCommand(
            featureFullName, featureVersion, updateSite, null, "false");
      startListeningForBundleInstallation();
      command.run();
      command.applyChangesNow();
      stopListeningForBundleInstallation();
      startInstalledBundles();

Once the feature installed, I would later uninstall it by doing this:

      DisableCommand disable = new DisableCommand(
            featureFullName, null, null, "false");
      disable.run();
      disable.applyChangesNow();
      UninstallCommand uninstall = new UninstallCommand(
            featureFullName, null, null, "false");
      uninstall.run();
      uninstall.applyChangesNow();

Now, for some reason, the DisableCommand is failing. It looks to me like
because I send it a null for toSite, it tries to find a configured site and
use that. But for some reason it is deciding that the site it finds is not
a proper "product site" because of a missing marker .eclipseproduct. So it
uses null for the site and eventually throws a NPE.

I suspect that perhaps it is the InstallCommand that is failing to
configure the site properly, and the DisableCommand is failing because the
.eclipseProduct marker was never properly plopped down by the install, but
that's just a guess.

I cannot find any other examples or docs, so any advice from the keepers of
the elusive InstallCommand and DisableCommand knowledge would be most
appreciated.

On a side note, the only way I can figure to get my installed bundles to
start properly is to create a service listener and detect all the bundles
that come in with the install. Then I manually start any bundle I detected
that has either a Service-Component or Bundle-Activator. Yikes! Is there a
better way to do this? I see an EnableCommand. Is that the ticket?

Better still, can anyone provide some sort of overview as to the sanctioned
way to use all these commands and specifically what a "toSite" is supposed
to be?

Thanks,

Paul VanderLei
Embedded Java Enablement Team
1750 Ridgemoor SE
Grand Rapids, MI 49506
616.975.1985
pvlei@xxxxxxxxxx

"I don't see architecture coming from you." -Jerry Seinfeld




Back to the top