Java 11 and spring boot - load resource from dependency jar from spring boot applications' fat jar

Viewed 325

I am having an issue upgrading my code from Java 8 to Java 11.

I have a spring boot application, the app is packaged as a fat jar. The app also depends on ebay api, which is packaged in ebay-sdk-core-1131.jar file.

The above configuration works fine in Oracle Java 8. Now I am trying to use zulu open JDK 11, I got this exception:

[INFO ] 2020-12-28 12:41:34.997 [ForkJoinPool-1-worker-3] SdkAPIInterfaceServiceLocator - loading wsdl : jar:file:/home/my-application-1.0.jar!/BOOT-INF/lib/ebay-sdk-core-1131.jar!/eBaySvc.wsdl
[ERROR] 2020-12-28 12:41:35.003 [ForkJoinPool-1-worker-3] ApiCall - java.lang.NullPointerException

In fact I have other wsdl files in other dependency libs, they all failed to load in Java 11. They are all OK in Java 8.

This will throw NPE in java 11, but not java 8 (run as fat jar):

import org.springframework.core.io.ClassPathResource;
ClassPathResource cp = new ClassPathResource("/wsdl/wsdl.xml");

Spring boot is at 2.3.7.RELEASE.

Any ideas?

Update:

Forgot to mention the above was running from a docker container.

If I run it locally on my dev machine, (not fat spring jar, instead file system), and it works:

[INFO ] 2020-12-28 09:04:03.153 [ForkJoinPool-1-worker-3] SdkAPIInterfaceServiceLocator - loading wsdl : jar:file:/home/me/work/git/app/app-dao.jar/libs/ebay-sdk-core-1131.jar!/eBaySvc.wsdl

[INFO ] 2020-12-28 09:04:26.127 [ForkJoinPool-1-worker-3] SdkAPIInterfaceServiceLocator - wsdl loaded and service initialized.

Update 2:

More logs:

com.ebay.sdk.SdkException: ApiCall.execute() - null
        at com.ebay.sdk.ApiCall.executeByApiName(Unknown Source) ~[ebay-sdk-core-1131.jar!/:?]
        at com.ebay.sdk.ApiCall.execute(Unknown Source) ~[ebay-sdk-core-1131.jar!/:?]
        at com.ebay.sdk.call.GetOrdersCall.getOrders(GetOrdersCall.java:169) ~[ebay-sdk-calls-1131.jar!/:?]
        at com.company.job.tasks.ebay.EBaySalesList.load(EBaySalesList.java:119) [classes!/:?]

Thanks

0 Answers
Related