This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: LegacyRegistryService ClassCastException ??
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Jan 22, 2007
07:50 PM
LegacyRegistryService ClassCastException ??
Hello,
I'm getting the following ClassCastException when removing a software Object using the legacyRegistryservice (see code below). any ideas of what I'm doing wrong?
java.lang.ClassCastException: com.installshield.product.LegacyGenericSoftwareObject
at com.installshield.product.service.legacyregistry.LegacyPureJavaRegistryServiceImpl.removeSoftwareObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.installshield.wizard.service.LocalImplementorProxy.invoke(Unknown Source)
at com.installshield.wizard.service.AbstractService.invokeImpl(Unknown Source)
at com.installshield.product.service.legacyregistry.LegacyGenericRegistryService.removeSoftwareObject(Unknown Source)
at xxxxxxxxxxx.actions.RemoveLegacyObject.install(RemoveLegacyObject.java:31)
at com.installshield.product.service.product.PureJavaProductServiceImpl.installProductAction(Unknown Source)
at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.getResultForProductAction(Unknown Source)
at com.installshield.product.service.product.InstallableObjectVisitor.visitComponent(Unknown Source)
at com.installshield.product.service.product.InstallableObjectVisitor.visitInstallableComponents(Unknown Source)
at com.installshield.product.service.product.InstallableObjectVisitor.visitProductBeans(Unknown Source)
at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.install(Unknown Source)
at com.installshield.product.service.product.PureJavaProductServiceImpl$Installer.execute(Unknown Source)
at com.installshield.wizard.service.AsynchronousOperation.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
and the code:
LegacyRegistryService regService = (LegacyRegistryService) getService(LegacyRegistryService.NAME);
LegacySoftwareObject softObj = regService.getNewestSoftwareObject(mUID);
if (softObj != null)
{
SoftwareObjectKey myKey = softObj.getKey();
regService.removeSoftwareObject(myKey);
}
I'm getting the following ClassCastException when removing a software Object using the legacyRegistryservice (see code below). any ideas of what I'm doing wrong?
java.lang.ClassCastException: com.installshield.product.LegacyGenericSoftwareObject
at com.installshield.product.service.legacyregistry.LegacyPureJavaRegistryServiceImpl.removeSoftwareObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.installshield.wizard.service.LocalImplementorProxy.invoke(Unknown Source)
at com.installshield.wizard.service.AbstractService.invokeImpl(Unknown Source)
at com.installshield.product.service.legacyregistry.LegacyGenericRegistryService.removeSoftwareObject(Unknown Source)
at xxxxxxxxxxx.actions.RemoveLegacyObject.install(RemoveLegacyObject.java:31)
at com.installshield.product.service.product.PureJavaProductServiceImpl.installProductAction(Unknown Source)
at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.getResultForProductAction(Unknown Source)
at com.installshield.product.service.product.InstallableObjectVisitor.visitComponent(Unknown Source)
at com.installshield.product.service.product.InstallableObjectVisitor.visitInstallableComponents(Unknown Source)
at com.installshield.product.service.product.InstallableObjectVisitor.visitProductBeans(Unknown Source)
at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.install(Unknown Source)
at com.installshield.product.service.product.PureJavaProductServiceImpl$Installer.execute(Unknown Source)
at com.installshield.wizard.service.AsynchronousOperation.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
and the code:
LegacyRegistryService regService = (LegacyRegistryService) getService(LegacyRegistryService.NAME);
LegacySoftwareObject softObj = regService.getNewestSoftwareObject(mUID);
if (softObj != null)
{
SoftwareObjectKey myKey = softObj.getKey();
regService.removeSoftwareObject(myKey);
}
(2) Replies
‎Jan 23, 2007
04:18 PM
I've been able to go pass the ClassCastException now by recompiling my project with an updated engine.jar
But, even after calling removeSoftwareObject, the registry has not been updated and i'm still able to retrieve the softwareObject from the registry.
I also tried to call finalizeRegistry(), but this didn't change anything.
Please let me know if anybody has been able to use the LegacyRegistryService to cleanup the registry of a product installed with ISMP 5 and updated with a new version installed with ISMP 11.5
Thanks.
But, even after calling removeSoftwareObject, the registry has not been updated and i'm still able to retrieve the softwareObject from the registry.
I also tried to call finalizeRegistry(), but this didn't change anything.
Please let me know if anybody has been able to use the LegacyRegistryService to cleanup the registry of a product installed with ISMP 5 and updated with a new version installed with ISMP 11.5
Thanks.
‎Jan 25, 2007
10:37 AM
I could be wrong on this, but along with the finalizeRegistry() call there is also an initializeRegistry() call. Is it possible that your finalize call is making the change in the registry (on disk), but the value is not being changed in memory. You may need to "reload" the registry into memory (using iniitialize) to "see" the change. Just a guess.