RE: Liferay 7.2.1-ga2/java11 can't load com.sun.xml.ws.spi.ProvideImpl

Sascha Hofrichter, modified 5 Years ago. New Member Posts: 8 Join Date: 1/17/20 Recent Posts
Hey guys, we have some issues with the Classloader in Liferay 7.2.1-ga2 and the usage of java 11 (OpenJDK Zulu 11.0.5).
Long story short. We built a portlet which uses a self-written library. This lib makes SOAP calls (we know SOAP is dead :-P ) to another backend. Yes, we know, that the javax.* and com.sun.xml.ws.* is not included anymore in the JDK. In our build.gradle file we add following dependencies via compileInclude to ship them with our portlet:
* compileInclude 'com.sun.xml.bind:jaxb-ri:2.4.0-b180830.0438'
* compileInclude 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
* compileInclude 'javax.jws:javax.jws-api:1.1'
* compileInclude 'javax.xml.ws:jaxws-api:2.3.1'
* compileInclude 'com.sun.xml.ws:rt:2.3.1'
First of all, at build time already is working. Now, at runtime, we trigger our lib to get some data from the other backends. In the lib will be used a instance of ProviderImpl of the package com.sun.xml.ws.spi, but the classloader doesn't find the ProviderImpl class. But the jar, which provides the package, is already in our portlet (it's the rt-2.3.1). Also, we have to add the libraries directly into the Tomcats lib and/or the lib/ext folder. Nothing happens. The classloader has no ProviderImpl class. If we create a new instance of the ProviderImpl class directly, we get an instance but the instance is emtpy(!?, what the heck?).
We need to use our library with the SOAP calls and can't re-write this lib to provide REST-interfaces.
Has anyone an idea what we can do or what we do wrong?
thumbnail
Christoph Rabel, modified 5 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
The following ticket and the explanation should help you. Since ProviderImpl was removed, Liferay has added their own implementation. Unfortunately, it isn't found automatically and really tricky to make it available to your implementation.
https://issues.liferay.com/browse/LPS-98339