Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Changes from RCP 4.9 to 4.10?(The type org.eclipse.swt.graphics.Image cannot be resolved. It is indirectly referenced from required .class files)
Changes from RCP 4.9 to 4.10? [message #1800461] Fri, 28 December 2018 19:46 Go to next message
Christian Derksen is currently offline Christian DerksenFriend
Messages: 11
Registered: September 2017
Junior Member
Hi there,

we have used tycho to build our RCP application for some time now. With a new Eclipse RCP release, we also moved forward with our target platform; normally without any problems.
With the update to the 2018-12 version of Eclipse RCP (4,10), we now have problems to build our 'core' bundle since the build process will be interrupted with the following error message:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.3.0:compile (default-compile) on project org.agentgui.core: Compilation failure: Compilation failure: 
[ERROR] D:\20 GIT\01_AgentGui-OSGI\eclipseProjects\org.agentgui\bundles\org.agentgui.core\src\agentgui\envModel\graph\controller\NetworkModelFileImporter.java: 
[ERROR] 	/**
[ERROR] 	^
[ERROR] The type org.eclipse.swt.graphics.Image cannot be resolved. It is indirectly referenced from required .class files
[ERROR] 1 problem (1 error)


The funnny or confusing thing is that this class (NetworkModelFileImporter.java) even does not need any SWT stuff and that, if we build based on Eclipse RCP 4.9, we don't have any problems.

If this is a bug, I can report this to Bugzilla too.
If somebody has suggestions, please let me know.

Best wishes,
Christian
Re: Changes from RCP 4.9 to 4.10? [message #1800569 is a reply to message #1800461] Wed, 02 January 2019 16:02 Go to previous messageGo to next message
Peter Pinnau is currently offline Peter PinnauFriend
Messages: 10
Registered: October 2015
Junior Member
Same problem here.
Re: Changes from RCP 4.9 to 4.10? [message #1800588 is a reply to message #1800461] Thu, 03 January 2019 01:49 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4507
Registered: July 2009
Senior Member

It does say "indirectly referenced from required .class files", meaning a transitive
dependency.


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Changes from RCP 4.9 to 4.10? [message #1800709 is a reply to message #1800588] Sun, 06 January 2019 19:25 Go to previous messageGo to next message
Christian Derksen is currently offline Christian DerksenFriend
Messages: 11
Registered: September 2017
Junior Member
Could it be of help, to know the dependecies of the bundle? If yes, these are the bundles that are required by the bundle 'org.agentgui.core':

Require-Bundle: de.enflexit.api,
de.enflexit.common,
de.enflexit.oidc,
de.enflexit.oshi,
de.enflexit.db.hibernate,
de.enflexit.db.mySQL,
org.agentgui.lib.scimark,
org.agentgui.lib.jade,
org.agentgui.lib.jFreeChart,
org.agentgui.lib.jung,
org.agentgui.lib.jep,
org.agentgui.lib.googleTranslate,
ch.qos.logback.classic,
ch.qos.logback.core,
org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.e4.core.di,
org.eclipse.e4.ui.model.workbench,
org.eclipse.e4.ui.services,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.ui.di,
org.eclipse.equinox.p2.operations,
org.eclipse.equinox.p2.metadata,
org.eclipse.osgi.services

Additionally we import:
javax.inject;,
org.slf4j;
Re: Changes from RCP 4.9 to 4.10? [message #1800758 is a reply to message #1800709] Mon, 07 January 2019 20:52 Go to previous messageGo to next message
Eclipse UserFriend
That's likely because you're trying to build using a 32-bit platform. With 4.10, all 32-bit platforms have been removed.
Re: Changes from RCP 4.9 to 4.10? [message #1800789 is a reply to message #1800758] Tue, 08 January 2019 11:52 Go to previous messageGo to next message
Peter Pinnau is currently offline Peter PinnauFriend
Messages: 10
Registered: October 2015
Junior Member
Brian de Alwis wrote on Mon, 07 January 2019 20:52
That's likely because you're trying to build using a 32-bit platform. With 4.10, all 32-bit platforms have been removed.


Thanks! I removed 32-bit targets. After that the plugins can be build but the product build fails:

EDIT: Got it working. There was an old entry "org.eclipse.equinox.ds" in the start-level configuration of the product.

The product build failed with:

Cannot complete the install because one or more required items could not be found.
 Software being installed: System Concept DMS 1.3.36 (System Concept DMS 1.3.36)
 Missing requirement: toolinggtk.linux.x86_64org.eclipse.equinox.ds 1.3.36 requires 'osgi.bundle; org.eclipse.equinox.ds 1.5.200.v20180827-1235' but it could not be found
 Cannot satisfy dependency:
  From: System Concept DMS 1.3.36 (System Concept DMS 1.3.36)
  To: org.eclipse.equinox.p2.iu; toolingSystem Concept DMS.configuration [1.3.36,1.3.36]
 Cannot satisfy dependency:
  From: toolingSystem Concept DMS.configuration 1.3.36
  To: org.eclipse.equinox.p2.iu; toolinggtk.linux.x86_64org.eclipse.equinox.ds [1.3.36,1.3.36]

[Updated on: Tue, 08 January 2019 12:06]

Report message to a moderator

Re: Changes from RCP 4.9 to 4.10? [message #1800791 is a reply to message #1800789] Tue, 08 January 2019 12:16 Go to previous messageGo to next message
Eclipse UserFriend
Your first error is standard Maven behaviour when failing to resolve an artifact. Usually can be cured by running Maven with -U or removing the artifact's ~/.m2/repository/GAV/*.lastUpdate. Did you really fork Tycho?

The second problem is that you're explicitly including the Equinox Declarative Services implementation bundle (org.eclipse.equinox.ds) which was removed in 2018-12 -- Equinox shares the same implementation with Apache Felix and the org.eclipse.equinox.ds bundle was really just a wrapper to pull in the org.apache.felix.scr bundle. As Tycho 1.3 now supports resolving p2 and OSGi capabilities, and the Eclipse bundles now use these capabilities to express a requirement for DS, you don't need to explicitly reference the DS bundle.
Re: Changes from RCP 4.9 to 4.10? [message #1800812 is a reply to message #1800791] Tue, 08 January 2019 14:47 Go to previous messageGo to next message
Peter Pinnau is currently offline Peter PinnauFriend
Messages: 10
Registered: October 2015
Junior Member
Brian de Alwis wrote on Tue, 08 January 2019 12:16

The second problem is that you're explicitly including the Equinox Declarative Services implementation bundle (org.eclipse.equinox.ds) which was removed in 2018-12


Exactly. Thank you very much. Got it working now.

Next step is to get ready for Java 11 (OpenJDK 11). The tycho build suceeds but the product can not be started.

Several components have been removed from Java 11 like javax.annotation, java.xml ...
I included the bundles javax.annotation and javax.xml directly but I receive:
Caused by: java.lang.NoClassDefFoundError: com/sun/istack/Pool which seems to be a JAXB default impl dependency

My product uses JAXB. Putting jaxb-api and jax-impl in the classpath of the plugin which needs them seems not to be sufficent.

Here:
https://www.eclipse.org/lists/cross-project-issues-dev/msg16283.html

an artifact called com.sun.xml.bind:jaxb-osgi is mentioned which includes everythig needed for JAXB.
But I have no idea how to configure my tycho build to use it.

Is there a documentation how to export an eclipse product with tycho to run with Java 11?
Re: Changes from RCP 4.9 to 4.10? [message #1800814 is a reply to message #1800812] Tue, 08 January 2019 15:16 Go to previous messageGo to next message
Eclipse UserFriend
Make sure you specify those packages in `Import-Package`. The Eclipse Orbit project provides a number of javax.* bundles.

https://www.eclipse.org/orbit/
Re: Changes from RCP 4.9 to 4.10? [message #1800825 is a reply to message #1800814] Tue, 08 January 2019 18:59 Go to previous messageGo to next message
Christian Derksen is currently offline Christian DerksenFriend
Messages: 11
Registered: September 2017
Junior Member
Also some good new from my side:

1) After removing the 32-bit versions from my tycho configuration, Maven was able to build the bundle 'org.agentgui.core'.
2) After that, and similar to Peter, the product build failed, which required to exchange the 'old' 'org.eclipse.equinox.ds' - bundle with the bundle 'org.apache.felix.scr'
(=> for those that want to do that in the product editor: simply remove the ds-bundle and press 'Add Recommended ...'. - this should automatically add the scr-bundle with Auto-Start and Start Level 2)

Thank you very much for your help!
Re: Changes from RCP 4.9 to 4.10? [message #1800864 is a reply to message #1800814] Wed, 09 January 2019 08:57 Go to previous messageGo to next message
Peter Pinnau is currently offline Peter PinnauFriend
Messages: 10
Registered: October 2015
Junior Member
Brian de Alwis wrote on Tue, 08 January 2019 15:16
Make sure you specify those packages in `Import-Package`. The Eclipse Orbit project provides a number of javax.* bundles.

https://www.eclipse.org/orbit/


I am not able to get this working at the moment. Product starts without errors from Eclipse IDE using OpenJDK 11 (which is in fact still version 10 in Ubuntu 18.04 LTS).

I added Orbit repository to my tycho configuration and

Import-Package: javax.annotation, javax.xml, javax.xml.bind


to manifest.mf. After rebuildung with tycho and starting the product it complains again about javax.annoation.
So I added javax.annotation to require-bundels as well. After that I receive error converning jaxax.xml.

I added javax.annotation, javax.xml, javax.xml.bind and com.sun.xml.bind to require-bundles and import-packages:

javax.xml.bind.JAXBException
 - with linked exception:
[java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory]
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:186)


Can you please explain what require-bundle and import-package does or what the difference is? Or is there a good tutorial about OSGI bundles, Orbit and tycho anywhere?

I am working on RCP products for years but never went deep into OSGI.
Re: Changes from RCP 4.9 to 4.10? [message #1800879 is a reply to message #1800461] Wed, 09 January 2019 11:12 Go to previous messageGo to next message
Peter Pinnau is currently offline Peter PinnauFriend
Messages: 10
Registered: October 2015
Junior Member
The reason for java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory seems to be:

JAXB implementation comes with Orbit component:
com.sun.xml.bind. It includes com.sun.xml.bind.v2.ContextFactory (so without internal)

For whatever reason JAXBContext.newInstance() looks for this class in an internal package.

I believe that JAX API and impl version do not fit together. Maybe the API is pulled from the Eclipse Repo and impl from Orbit which provides an realtivly old version of JAXB.
Re: Changes from RCP 4.9 to 4.10? [message #1800904 is a reply to message #1800879] Wed, 09 January 2019 14:41 Go to previous message
Peter Pinnau is currently offline Peter PinnauFriend
Messages: 10
Registered: October 2015
Junior Member
The product now runs with OpenJDK 11. I put everything neccessary for JAXB into the classpath of the plugin which uses JAXB. javax.annotation via require-bundle in manifest.mf.

In my case I needed to add 'org.apache.felix.scr' with autostart=true und startLevel = 2 to the product configuration. Otherwise some exceptions appear in the .log and the application terminates without notice.

I first deleted the startlevel entry for 'org.eclipse.equinox.ds' instead of replacing it with 'org.apache.felix.scr'.

Since I related the issues to Java 11 I went back the whole way to Java 8, Eclipse 2018-09, tycho 1.2.0 but the product still terminated.

This took several hours but now it is working.
Previous Topic:Custom Tooltip getting disposed when perspective is changed in Windows -10
Next Topic:Using latest SWT build in legacy RCP app
Goto Forum:
  


Current Time: Thu Dec 26 14:34:47 GMT 2024

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

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

Back to the top