Unable to create SAAJ meta-factory after packaging as JAR

I'm using Java 11 and in addition to the

implementation group: 'com.sun.xml.messaging.saaj', name: 'saaj-impl', version: '1.5.2'


implementation group: 'javax.xml.soap', name: 'javax.xml.soap-api', version: '1.4.0'

but necessarily turn off implementation group: 'com.sun.xml.messaging.saaj', name: 'saaj-impl', version: '1.5.2'

After switching my jdk to 11,I had same problem. Uppgrading apache.cxf jar to 3.5.1 solved my problem.Was using 3.1.2 with jdk 1.8

I just added the following dependency to my project:


If you are using a version older than 1.5.1, you need to create the file META-INF/services/javax.xml.soap.SAAJMetaFactory with the following line to provide the fully-qualified name of the SAAJ factory class and it worked:


The javax.xml.soap.saaj-api seems to be abandoned. And it's very strange that a package named com.sun is the one to work. Anyway, it works.