Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Injection problems while migrating RCP application from 4.6 to 4.14(Starting application on new target platform throws InjectionException on various plugins)
Injection problems while migrating RCP application from 4.6 to 4.14 [message #1824498] Thu, 16 April 2020 09:17 Go to next message
Bjoern Berg is currently offline Bjoern BergFriend
Messages: 47
Registered: November 2009
Location: Essen
Member
I have tried to migrate an existing RCP application from Eclipse 4.6 to 4.14. The underlying target platform is build with Tycho 1.5.0 and all required plugins are included into the target platform. The target platform itself is referenced in Eclipse as directory (little bit easier than as p2).

Now when I start the application inside Eclipse to test it, I got several InjectionExceptions not only from my Plugins, but as well as from the workbench plugin:

org.eclipse.e4.core.di.InjectionException: Unable to process "BindingProcessingAddon.broker": no actual value was found for the argument "IEventBroker".
at org.eclipse.e4.core.internal.di.InjectorImpl.reportUnresolvedArgument(InjectorImpl.java:485)
at org.eclipse.e4.core.internal.di.InjectorImpl.resolveRequestorArgs(InjectorImpl.java:476)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:128)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:408)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:345)
[cutted rest of exception]

or

org.eclipse.e4.core.di.InjectionException: Unable to process "MinMaxAddon.eventBroker": no actual value was found for the argument "IEventBroker".
at org.eclipse.e4.core.internal.di.InjectorImpl.reportUnresolvedArgument(InjectorImpl.java:485)
at org.eclipse.e4.core.internal.di.InjectorImpl.resolveRequestorArgs(InjectorImpl.java:476)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:128)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:408)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:345)
[cutted rest of exception]

I can narrow it down to the following classes which cannot be injected after migration to the new target platform:

- IEventBroker
- EPartService
- and several own written classes

Launcher configuration was changed to org.apache.felix.scr instead of org.eclipse.equinox.ds.

Application is also launched with the Arguments -clear and -clearPersistedState.

I followed the instructions in Eclipse RCP FAQ concerning javax.annotation and Output on osgi console (stripped) looks like the following while executing "packages javax.annotation":

osgi.wiring.package; bundle-symbolic-name="javax.annotation"; bundle-version:Version="1.2.0.v201602091430"; version:Version="1.2.0"; osgi.wiring.package="javax.annotation"<javax.annotation_1.2.0.v201602091430 [30]>
org.glassfish.jersey.bundles.repackaged.jersey-guava_2.22.4 [153] imports
org.glassfish.jersey.core.jersey-server_2.22.4 [156] imports
org.glassfish.jersey.core.jersey-client_2.22.4 [154] imports
org.glassfish.jersey.core.jersey-common_2.22.4 [155] imports
org.eclipse.e4.tools.services_4.8.300.v20190708-1118 [87] imports
osgi.wiring.package; bundle-symbolic-name:List<String>="org.eclipse.osgi,system.bundle"; bundle-version:Version="3.15.100.v20191114-1701"; version:Version="0.0.0"; osgi.wiring.package="javax.annotation"<org.eclipse.osgi_3.15.100.v20191114-1701 [0]>
statusbar_3.10.0.qualifier [179] imports
org.eclipse.core.resources_3.13.600.v20191122-2104 [75] imports
org.eclipse.core.filebuffers_3.6.800.v20191122-2108 [71] imports
org.eclipse.e4.ui.bindings_0.12.700.v20191105-1310 [88] imports
org.eclipse.e4.ui.services_1.3.700.v20190930-1643 [95] imports
javax.activation_1.1.0.v201211130549 [29] imports
org.eclipse.ui.forms_3.8.200.v20191114-0830 [140] imports
org.eclipse.e4.ui.workbench3_0.15.300.v20190926-0808 [101] imports

Any idea what's getting wrong here?
Re: Injection problems while migrating RCP application from 4.6 to 4.14 [message #1824499 is a reply to message #1824498] Thu, 16 April 2020 09:31 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
The org.eclipse.core.runtime bundle had javax.inject as an optional dependency, which it previously reexported, but not anymore.

Clients have to Import-Package: javax.inject explicitly if they need it.

https://www.eclipse.org/eclipse/news/4.13/platform_isv.php#javax-injext
Re: Injection problems while migrating RCP application from 4.6 to 4.14 [message #1824500 is a reply to message #1824499] Thu, 16 April 2020 09:38 Go to previous messageGo to next message
Bjoern Berg is currently offline Bjoern BergFriend
Messages: 47
Registered: November 2009
Location: Essen
Member
Does that mean I should add javax.annotation and javax.inject to all of my plugins as Import-Package without version which make use of DI?
Re: Injection problems while migrating RCP application from 4.6 to 4.14 [message #1824523 is a reply to message #1824500] Thu, 16 April 2020 20:12 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
According to the documentation, yes you should.
Re: Injection problems while migrating RCP application from 4.6 to 4.14 [message #1826162 is a reply to message #1824523] Mon, 20 April 2020 14:09 Go to previous messageGo to next message
Bjoern Berg is currently offline Bjoern BergFriend
Messages: 47
Registered: November 2009
Location: Essen
Member
I have changed it, so that every plugin which uses @Inject now Imports javax.inject. Some Plugins had already a dependency to jax.inject plugin.
My target platform also contains the javax.inject.jar provided by the Eclipse update site.

But the error is still the same. Plugins provided by the Eclipse platform also fail to start:

!ENTRY org.eclipse.e4.ui.workbench 4 0 2020-04-20 16:04:26.450
!MESSAGE Unable to create class 'org.eclipse.e4.ui.workbench.addons.cleanupaddon.CleanupAddon' from bundle '98'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Unable to process "CleanupAddon.eventBroker": no actual value was found for the argument "IEventBroker".
at org.eclipse.e4.core.internal.di.InjectorImpl.reportUnresolvedArgument(InjectorImpl.java:485)
at org.eclipse.e4.core.internal.di.InjectorImpl.resolveRequestorArgs(InjectorImpl.java:476)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:128)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:408)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:345)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:227)
[cutted rest of exception]

Any more ideas?
Re: Injection problems while migrating RCP application from 4.6 to 4.14 [message #1826179 is a reply to message #1826162] Mon, 20 April 2020 16:52 Go to previous messageGo to next message
Bjoern Berg is currently offline Bjoern BergFriend
Messages: 47
Registered: November 2009
Location: Essen
Member
I added org.eclipse.equinox.ds to my plugins in the target platform (not in startup configuration) and now application starts.
Why do I need this Plugin if it is deprecated and officially removed?
Re: Injection problems while migrating RCP application from 4.6 to 4.14 [message #1826188 is a reply to message #1826179] Mon, 20 April 2020 18:12 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
org.eclipse.equinox.ds has a dependency on org.apache.felix.scr, was org.apache.felix.scr included in your target platform?

org.apache.felix.scr is included in the org.eclipse.e4.rcp feature.
Re: Injection problems while migrating RCP application from 4.6 to 4.14 [message #1826251 is a reply to message #1826188] Wed, 22 April 2020 07:02 Go to previous message
Bjoern Berg is currently offline Bjoern BergFriend
Messages: 47
Registered: November 2009
Location: Essen
Member
org.apache.felix.scr was in my target platform.
I was wondering that I had to include org.eclipse.equinox.ds into my target platform. Without this plugin injection does not work in my application - and I can narrow it down to this plugin.
Previous Topic:Problem building a product
Next Topic:IDs for placeholders and parts
Goto Forum:
  


Current Time: Tue Apr 16 14:44:55 GMT 2024

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

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

Back to the top