I've been trying to get the Java library "com/onelogin/saml-java-core" to work in Lucee (works in ACF), and I haven't been able to find any solution or workaround. As I was preparing to write this up, I saw that seems very related, but I didn't want to hijack that ticket in case they are unrelated.
My issue Lucee keeps throwing one of two exceptions on any attempt to instantiate these objects.
The first exception is always java.lang.ClassNotFoundException for org/slf4j/LoggerFactory. Every subsequent refresh of the page shows a standard "Could not initialize class <classname>" message. Lucee bundle slf4j by default, and the version (1.7.12) is even the same version that java.saml.core.2.5.0 was compiled against.
Here is a block of code that reproduces the issue for me:
And here is the stack trace:
Ubuntu Linux 20.04
Java tested: Lucee bundled JDK, OpenJDK 8u265, AdoptOpenJDK 11.0.8
I've checked this ticket in widdows and seen the below issue in tomcat while I tested with java-saml-core-2.4.1.jar.
And , did you test this with this.javasettings?. its works fine for me if using with this.
Please check and report here.
That’s interesting! I had been putting jars in the application’s “./WEB-INF/lib” and other default classpath folders, but as you said the problem is solved if I load the jar using this.javasettings.
Thank you for the workaround!
To clarify though, I still think this is a bug.
It should be possible to put jars in Tomcat’s common.loader paths or ./WEB-INF/lib without it throwing ClassNotFoundExceptionon a jar that clearly exists.
Yes, If we add java.saml.core.2.5.0.jar file means, it throws an error like that ClassNotFoundException. will confirm about this issue.