Skip to content
Advertisement

Unable to create SAAJ meta-factory after packaging as JAR

For testing an application I am creating SOAP messages. This works when run directly from Eclipse (Oxygen.1a) but after packaging as runnable jar (option: package required libraries into generated jar) I get the following error:

JavaScript

triggered by:

JavaScript

So I understand that the MessageFactory uses a sun package

JavaScript

But I am absolutly clueless as to why it is unable to find this class after packaging to a runnable JAR. Any hints or directions would be greatly apreciated.

Advertisement

Answer

I just added the following dependency to my project:

JavaScript

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:

JavaScript

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.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement