SOLVED OSLC Lyo API fails to authenticate in ELM system with Jazz Authorization Server enabled

Hi,

I’m trying to execute the lyo-client-sample located at ‘lyo-samples/lyo-client-samples at master · OSLC/lyo-samples · GitHub’ with my IBM ELM System which has Jazz Authorization Server enabled for authentication.
Java version: 17
ELM system 7.0.2 SR1, Authentication on JAS and has ERM, EWM , ETM registered.
Execution Arguments: -url https://xxx.xxx.com/rm -user testuser -password testpassword -project “JKE Banking (RM)”

It throws following exception in the method RootServicesHelper.processRootServices().
Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/jena/util/Metadata
at org.apache.jena.query.ARQ.(ARQ.java:607)
at org.apache.jena.sparql.system.InitARQ.start(InitARQ.java:29)
at org.apache.jena.base.module.Subsystem.lambda$initialize$1(Subsystem.java:117)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.apache.jena.base.module.Subsystem.forEach(Subsystem.java:193)
at org.apache.jena.base.module.Subsystem.forEach(Subsystem.java:169)
at org.apache.jena.base.module.Subsystem.initialize(Subsystem.java:115)
at org.apache.jena.sys.JenaSystem.init(JenaSystem.java:89)
at org.apache.jena.rdf.model.ModelFactory.(ModelFactory.java:48)
at org.eclipse.lyo.client.RootServicesHelper.processRootServices(RootServicesHelper.java:145)
at org.eclipse.lyo.client.RootServicesHelper.(RootServicesHelper.java:127)
at org.eclipse.lyo.samples.client.ERMSample.main(ERMSample.java:154)
Caused by: java.lang.ClassNotFoundException: org.apache.jena.util.Metadata
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
… 12 more

I would appreciate any insights or pointers that could help identify the possible root cause of this exception.

Note: I also tried these samples on Jazz sandbox ELM 7.1 iFix003, However came across same error.

Thanks in advance for any support on this .

Best Regards,
elmUser

Hi

Seems that you are missing a class from the Jena library. Or it could also be because the result from your requests are confusing the Jena logic.

Are you executing the code as instructed in the readme file? that is, using maven?

The url you share may not be correct or complete.
https://xxx.xxx.com/rm

Can you put a breakpoint at/before this point to see what URL you have for the rootservices?
org.eclipse.lyo.client.RootServicesHelper.processRootServices(RootServicesHelper.java:145)

Try then to paste that url in your browser or using Postman. Can you get some xml file?

Hi Jad,

For the execution, I’ve been closely following the instructions provided in the README file. The project uses Maven, and I’ve verified that all dependencies are being pulled in correctly.

Although I’ve masked the actual URL in my earlier message, here’s an example using the Jazz Sandbox: https://jazz.net/sandbox01-ccm/web/rootservices

This Root Services URL is accessible, and I can see the project area name listed in the returned XML.

That said, I’m still encountering a NoClassDefFoundError related to a missing Jena class. According to the pom.xml, the project uses Jena version 4.8.0.

This exception occurs consistently at the same line of code—regardless of whether I use my on-prem ELM setup or the Jazz Sandbox. I wonder if JAS base authentication has anything to do with it.

Any further guidance or suggestions would be greatly appreciated.

Thanks & Regards,
Jay

Hello Jay @jay999g,

Eclipse Foundation has been having serious issues with their disk arrays (https://www.eclipsestatus.io) and the snapshot builds restored are significantly outdated in some cases.

I just pushed an update to refimpl and lyo-client-samples to pin Lyo to 7.0.0.Alpha2 instead of the floating SNAPSHOT. If you pull the latest changes, you should be able to get rid of the errors you have experienced.

Cheers,
Andrew

Hi Andrew,

Thank you for your feedback and pushing new updates on lyo-client-samples!

I went ahead and tried this sample code on jazz sandbox and it worked on CCM and RM (I updated code to support BASIC authentication) project areas.
I’ll go ahead and try it on my on-prem environment.

I’ll keep you updated on it.

Best Regards,
Jay

Hi Jay,

Glad to hear you’re making progress. Would appreciate a PR for the Basic auth in the RM sample if possible - has been on the TODO list for a while. In an on-prem environment, you may need to use JFS auth instead of Basic - cf.test-jazz_kth.sh vs test-jazz_net.sh.

All the best,
Andrew