4

I am migrating a legacy Java 8 project to Java 11.
The project is using this class javax.xml.rpc.Service
It was being picked up from a library/jar before (I mean in Java 8): jaxrpc.jar

But since I'm migrating to Java 11, and I must comply with the requirement of "unique visibility"
( see https://stackoverflow.com/a/53824670/2300597 ),
I had to remove the JAR that contains this class javax.xml.rpc.Service (jaxrpc.jar) from my project... because now (in Java 11, in fact it's since Java 9) only one module must provide/expose the javax.xml.rpc package. But I don't think this Service class is in the JDK.

So how do I solve this?

I still need javax.xml.rpc.Service but I cannot use the jar this class is in. I seem to be stuck here.

Btw, I have the same issue with javax.xml.rpc.ServiceException

What is the right way to solve such issues?

peter.petrov
  • 38,363
  • 16
  • 94
  • 159
  • 1
    Does [this Answer](https://stackoverflow.com/a/43574427/642706) help? – Basil Bourque Jan 18 '22 at 15:54
  • @BasilBourque Not really, it doesn't talk about the package I have in my question. I found a workaround though - I just patched the jaxrpc.jar by removing the `javax.xml.namespace` from it, and putting the patched version back in my project (this way I kept the `javax.xml.rpc` package). Seems `javax.xml.namespace` was the only package that was clashing with JDK provided packages (from the system modules). I wonder if that's the right solution though - just doing a surgery on the JAR, really?! – peter.petrov Jan 18 '22 at 16:50
  • @BasilBourque Why didn't they migrate javax.xml.rpc also into the JDK ?! That's weird. And the other thing is: jaxrpc.jar has no recent version. So... one is left only with the surgery option, I think. – peter.petrov Jan 18 '22 at 16:52

1 Answers1

6

The new maven coordinates for JAXRPC are here.

https://wiki.eclipse.org/Jakarta_EE_Maven_Coordinates

Specifically,

<groupId>jakarta.xml.rpc</groupId>
<artifactId>jakarta.xml.rpc-api</artifactId> 

I assume this might get you closer to something that works. However, this may not really be enough for you. JAX-RPC became JAX-WS a long time ago.


Some of the Jakarta EE specifications may be of interest to you:

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
BillRobertson42
  • 12,602
  • 4
  • 40
  • 57