I am currently trying to migrate from a Java 8 project to Java 12. (Hopefully) the last hurdle is an old WebService we are forced to use. Using the WebService 'as is' in Java 8 per se is not a problem, it has been working for many years.
The wsdl states:
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 -->
As far as I can see, new versions of WSDL2JAVA do not support this type of service any more (since they rely on Axis 2):
WSDLToJava Error: Rpc/encoded wsdls are not supported with CXF
To make this service usable (with Java 8 and 12), I need the following library:
<!-- https://mvnrepository.com/artifact/javax.xml.rpc/javax.xml.rpc-api -->
<dependency>
<groupId>javax.xml.rpc</groupId>
<artifactId>javax.xml.rpc-api</artifactId>
<version>1.1.2</version>
</dependency>
This is where the problem occurs. The library defines the partial package javax.xml which is not allowed any more since it is a Java system path. Any suggestions or workarounds? Did I overlook something?
EDIT: ZhekaKozlov was right about having to switch to jakarta. Now there is still an error left, because of Axis2, which is also required in the project.
<!-- https://mvnrepository.com/artifact/org.apache.axis2/axis2-kernel -->
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-kernel</artifactId>
<version>1.7.9</version>
</dependency>
Just adding this to a new Java 12 project makes org.w3c.dom.* (e.g. Document) unusable.
EDIT2: I finally got everything working. The program is running and there are no errors left in the code. Unfortunately, I cannot test the Axis Part of the application, because the services it connects to are only usable from within the environment of our clients, so this has to be tested. On both axis2 and axis2-adb I had to exlude two libraries:
<exclusions>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-stax-api_1.0_spec</artifactId>
</exclusion>
<exclusion>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
</exclusion>
</exclusions>
They were blocking org.w3c.dom.* and javax.xml.stream.* respectively.
Since Java EE was rebranded to Jakarta EE, you should use new artifacts:
<dependency>
<groupId>jakarta.xml.rpc</groupId>
<artifactId>jakarta.xml.rpc-api</artifactId>
<version>1.1.4</version>
</dependency>
The new artifact doesn't contain the split package anymore.