Need help using Sardine Java package in Lucee

I have reached the limit of my knowledge of using a java library in Lucee and need help.
(I have zero experience writing java which is probably the majority of my problem)

OS: Linux (3.10.0-957.21.2.el7.x86_64) 64bit
Java Version: 11.0.3 (AdoptOpenJDK) 64bit
Tomcat Version: 9.0.20
Lucee Version:

What I would like to do is to use Sardine to read from Sharepoint WebDav resource. Here is the link to the project

What I’ve done is download sardine 5.10 jar into {website}\WEB-INF/lucee/lib

Now when I run this code:

	sfactory = createObject("java", "com.github.sardine.SardineFactory"); 
	sardine = sfactory.begin("user","password");
	resources = sardine.list("http://fhc-sharepoint/Vault/DMRDocuments");

I get this error

Lucee Error (java.lang.NoClassDefFoundError)
Message javax/xml/bind/JAXBException
Stacktrace The Error Occurred in
**/var/lucee/infor_dev/vault.cfm: line 246**

> 244: sfactory = createObject("java", "com.github.sardine.SardineFactory");
> 245: sardine = sfactory.begin("user","password");
> **246: resources = sardine.list("http://fhc-sharepoint/Vault/DMRDocuments");**
> 247: </cfscript>
> 248:
Java Stacktrace lucee.runtime.exp.NativeException: javax/xml/bind/JAXBException
  at com.github.sardine.impl.SardineImpl.propfind(
  at com.github.sardine.impl.SardineImpl.list(
  at com.github.sardine.impl.SardineImpl.list(
  at com.github.sardine.impl.SardineImpl.list(
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method

Goggling around it seems that something called JAXAB has been removed from JDK and put somewhere else but I’m not sure how to load it with an OSGi extended createobject or finding what Jar files come to put in /lib/

Does anyone know what I need to do?

I figured I would start here as the package developer is not likely to know Lucee - any help would be greatly appreciated

Bowdoin, Maine USA

Based on the NoClassDefFound error, it would appear the Sardine lib has a Java class dependency that you have not included on the classpath. You appear to be missing the jaxb-api library. Based on Sardine’s dependencies listed in its pom.xml, you can find that here:

There are other dependencies listed that you may need to include. See:

You can identify them by looking in the “Dependencies” block of the XML (omitting any marked for ant of testing) or in the “Dependencies” section to the right of the page under the list of build tool examples.

You could also fix the issue, by building the sardine.jar with all dependencies and include that one.

Otherwise you need to include all dependencies with the correct version. I guess thats harder to maintain, if you are using multiple librarys which may use the same dependency with another version.

Try the latest RC, lots of java loading related stuff has been resolved since 5.3.2