Unresolved classpath warning when launching a Run Configuration

Symptom

When running an application (that could have been working previously) after the online central repository has been updated, the following warning pop-up can be displayed:

Unresolved classpath
[platform] does not provide implementation for:

  • [Foundation library]-[Version] (referenced by project [project])
    Proceed with launch?

image

if OK is pressed, the launch continues and the ClassNotFound exception happens:

=============== [ Initialization Stage ] ===============
=============== [ Launching on Simulator ] ===============
Exception in thread "bootstrap" java.lang.ClassNotFoundException: javax/net/ssl/KeyManagerFactory
	at java.lang.Throwable.fillInStackTrace(Throwable.java:79)
	at java.lang.Throwable.<init>(Throwable.java:30)
	at java.lang.Exception.<init>(Exception.java:10)
	at java.lang.ReflectiveOperationException.<init>(ReflectiveOperationException.java:10)
	at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:16)
=============== [ Completed Successfully ] ===============

SUCCESS

Description

MicroEJ workbench 4.1 has a technological limitation to embed the foundation libraries that do not match the declared API’s minor version.
A platform embeds a fixed version of a foundation library (e.g. EDC-1.2, BON-1.2, SSL-2.0…), this library is only used if its APIs are referenced by the module.ivy file:
image

When the dependencies are described with a fixed major version (like above), Ivy fetches the highest minor version of the API available. If it is higher than the embedded version of the library, MicroEJ is unable to do the link.

Solution

Different solutions exist:
A - Fix dependencies and keep using the online repository.
B - Use an older version of the repository. Old versions are available as offline repositories.
C - Update your platform to provide the latest versions of the foundation libraries.

A - Fix the ej.api.* dependencies

In your module.ivy, list all the ej.api libraries used and fix their minor versions:
<dependency org="ej.api" name="edc" rev="[1.2.0,1.3.0[" conf="provided->*" />
<dependency org="ej.api" name="bon" rev="[1.2.0,1.3.0[" conf="provided->*" />
<dependency org="ej.api" name="net" rev="[1.0.0,1.1.0[" conf="provided->*" />
<dependency org="ej.api" name="ssl" rev="[2.0.0,2.1.0[" conf="provided->*" />

B - Use an offline repository

Ivy can be configured to fetch its dependencies from a local (offline) version of the repository, the way to do it and link to a repository is explained on http://repository.microej.com/.

C - Update the platform to provide the latest foundation libraries

New minor version of foundation libraries will come when installing the latest MicroEJ architectures. For a platform to support them, some native functions may have to be added in the C drivers. Please contact our support to have more information.

Future versions of MicroEJ SDK and Studio will provide simpler module management.