Girish Chandran C
Girish Chandran C

Reputation: 111

Add and remove plugins to the plugin folder in a RCP application

I am a newcomer to Eclipse plugin development. When I came across certain plugin concepts, some questions arose in my mind.

For a plugin based product, if we would like to add a new feature, say to perform certain validation, we just need to drop a particular plugin in which the validation logic is written. Similarly, if we would like to remove certain features from our product, we just require to remove the particular plugin providing the feature.

I tried to do the same operation in one of the RCP product build by me. I tried to remove a plugin from the plugin folder to disable a particular feature in my application. But it was getting the error message as below,

!MESSAGE Bundle com.my.app.application_1.0.0.201208101553 [6] was not resolved.
!SUBENTRY 2 com.my.app.application 2 0 2012-08-17 12:37:13.256
!MESSAGE Missing imported package com.my.app.views.console_0.0.0.

!ENTRY org.eclipse.osgi 4 0 2012-08-17 12:37:13.256
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: Application "com.my.app.application.application" could not be found in the registry. The applications available are: org.eclipse.equinox.app.error.
    at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248)
    at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
    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:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

Could you please tell me why this error comes and how to overcome such errors?

Upvotes: 0

Views: 845

Answers (2)

twindham
twindham

Reputation: 960

If you want to be able to remove the com.my.app.views.console plugin without breaking your application, you are going to have to find a way to remove the hard dependency that your com.my.app.application plugin has on your com.my.app.views.console plugin.

Upvotes: 0

Qinto
Qinto

Reputation: 205

Each RCP product has a main plugin which defines an application (read more Eclipse RCP Tutorial by Lars Vogel). You removed a plugin which exports com.my.app.views.console package, but the package is required (imported) by the main plugin (com.my.app.application). Becuase of that, the main plugin couldn't be resolved and the application defined in that plugin couldn't be found - this is what you see in the exception message.

Upvotes: 2

Related Questions