Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Plugin/Bundle remains in STARTING status
Plugin/Bundle remains in STARTING status [message #1775001] Mon, 23 October 2017 11:55 Go to next message
Philipp Schäfer is currently offline Philipp SchäferFriend
Messages: 2
Registered: October 2017
Junior Member
I have an RCP plugin with a command, a binding for that command, and a handler that uses a property tester via an enableWith. Other than the corresponding classes for the handler and the property tester there is nothing else.

When I start an application with that plugin, the plugin never reaches the ACTIVE state and thus, the property tester is never instantiated, which causes the handler to be disabled forever.

I tried to get it to work with and without lazy activation policy, with and without forcePluginActivation on the enableWhen clause, and with a lower than default start level. Nothing worked.

What do I have change, so that the plugin is properly started?

plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="org.eclipse.core.expressions.propertyTesters">
      <propertyTester
            class="com.example.plugin.PropertyTester"
            id="com.example.plugin.PropertyTester"
            namespace="com.example.plugin"
            properties="configured"
            type="java.lang.Object">
      </propertyTester>
   </extension>
   <extension
         point="org.eclipse.ui.handlers">
      <handler
            class="com.example.plugin.Handler"
            commandId="com.example.plugin.command">
         <enabledWhen>
            <test
                  forcePluginActivation="true"
                  property="com.example.plugin.configured"
                  value="true">
            </test>
         </enabledWhen>
      </handler>
   </extension>
   <extension
         point="org.eclipse.ui.commands">
     <command
           id="com.example.plugin.command"
           name="Command">
     </command>
   </extension>
   <extension
         point="org.eclipse.ui.bindings">
        <key
              commandId="com.example.plugin.command"
              schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
              sequence="M3+F1">
        </key>
   </extension>
</plugin>


MANIFEST.MF

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: com.example.plugin
Bundle-SymbolicName: com.example.plugin;singleton:=true
Bundle-Version: 4.4.1745.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.eclipse.core.runtime;version="3.5.0",
 org.osgi.framework;version="1.8.0",
Require-Bundle: org.eclipse.core.expressions,
 org.eclipse.ui
Bundle-ActivationPolicy: lazy


Re: Plugin/Bundle remains in STARTING status [message #1778783 is a reply to message #1775001] Thu, 21 December 2017 12:13 Go to previous messageGo to next message
Philipp Schäfer is currently offline Philipp SchäferFriend
Messages: 2
Registered: October 2017
Junior Member
I could not solve the problem, but have a similar problem now.

I have a plug-in. The plug-in's functionality has two entry points from the users point of view: a preference page, and a context menu entry in a menu of a different plug-in.

The bundle activation policy is lazy. Thus, the plug-in is initially in the STARTING state.

When the user goes to the preference page and the plug-in is still in the STARTING state, the plug-in is properly started and goes to the ACTIVE state.

When the user open's the context menu with the entry and the plug-in is still in the STARTING state, the plug-in is not started. Thus, the HandlerProxy for the associated handler does not load the handler and just returns true for isEnabled [0].

How can I force my plug-in to get started without user interaction (or the user interaction 'opens the context menu that my menu entry belongs to')?

What was the rational for the HandlerProxy not loading the Handler for isEnabled [1]?

[0] https://github.com/eclipse/eclipse.platform.ui/blob/master/bundles/org.eclipse.ui.workbench/Eclipse%20UI/org/eclipse/ui/internal/handlers/HandlerProxy.java#L301

[1] https://github.com/eclipse/eclipse.platform.ui/commit/9828e56e0ffc3f682dca7ac05cc02b04a7b53257
Re: Plugin/Bundle remains in STARTING status [message #1811025 is a reply to message #1778783] Fri, 23 August 2019 18:54 Go to previous message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

You activation policy is lazy. This means that the bundle is not started until one of the classes in that bundle is loaded. What happens when you remove the Bundle-ActivationPolicy: lazy flag?
Previous Topic:how to run junit test case in a customized Eclipse workspace?
Next Topic:Handler enable/disable not working
Goto Forum:
  


Current Time: Thu Apr 18 14:44:58 GMT 2024

Powered by FUDForum. Page generated in 0.03210 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top