Skip to content

SCL REST API (org.simantics.scl.rest) unsupported with jersey versions 2.30.1 and above

The bundle org.simantics.scl.rest builds fine with current jersey versions. However, testing API with the latest platform versions caused the following error during runtime. Most likely any new platform version that has updated jersey to 2.30.1 or higher will have dependency issues with org.simantics.scl.rest bundle.

https://stackoverflow.com/questions/44088493/jersey-stopped-working-with-injectionmanagerfactory-not-found

ERROR [2024-06-04 20:52:28,877] org.simantics.scl.rest.SCLRESTServer: Could not start server 
java.lang.IllegalStateException: InjectionManagerFactory not found.
    at org.glassfish.jersey.internal.inject.Injections.lambda$lookupInjectionManagerFactory$0(Injections.java:74)
    at java.base/java.util.Optional.orElseThrow(Optional.java:408)

Similar issue has been fixed previously related to ATS in issue #153

The fix is to include org.glassfish.jersey.inject.jersey-hk2 bundle and make small code modifications. The branch release/1.52.2 was created that includes the required fixes.

It might be possible to merge the changes to master (squash commits! a lot of messy commits in release/1.52.2). The noteworthy change is changing the bundle to OSGI declarative service in this commit, which could be unintended and possibly expose the REST API automatically in some products?

Edited by Henrik Milan