LinkageError whilst trying to invoke CXF/SOAP webservice

后端 未结 2 1060
南笙
南笙 2021-01-07 03:42

I have a project (say myproject) in which I have hosted a CXF RESTful service and CXF WS/SOAP service, and running on JBoss (6.0.0.FINAL). The RESTful interface is used by a

相关标签:
2条回答
  • 2021-01-07 04:30

    LinkageError is JBoss is generally caused by your app packaging its own copies of certain libraries that JBoss considers restricted. These are usually things in the java.* and javax.* packages.

    Looking at your stack trace, I'd guess that the culprit is javax.activation.DataHandler. Check your app's bundled JAR files, make sure there's nothing like that in them. If there is, then remove it.

    It may not be javax.activation.DataHandler, but may be something it in turn depends on.

    0 讨论(0)
  • 2021-01-07 04:41

    I finally solved the problem but it is really weird.

    1. I added cxf-rt-frontend-jaxws and cxf-bundle-rs as dependencies and mark some exclusions -> jetty-server, gernomino-servlet.
    2. I had the beans.xml under WEB-INF folder but had to place it under src/main/resources. The beans.xml is expected to be under the classpath, instead of WEB-INF.

    Thanks for your responses.

    0 讨论(0)
提交回复
热议问题