1

IBM Worklight 6.2/ Liberty 8.5.5.1

For the custom implementation of Webservice,

  1. Java code had been written and jaxrpc.jar included in the server lib folder of worklight project

  2. While testing in the eclipse it works fine.

  3. When the build has moved to Testing environment the following error had thrown by the server.

Invocation of init method failed; nested exception is java.lang.LinkageError: 
loaderconstraint violation: loader (instance of com/ibm/ws/classloading/internal
/ParentLastClassLoader) previously initiated loading for a different type with name
"javax/xml/namespace/QName"

I understand that there is a conflict. So I have removed the QName.class from jaxrpc.jar which is in server/lib folder. However I could deploy and run it on Testing environment without error.

Since, this is not a solution so I tried by removing jaxrpc.jar from server/lib then compiler throws exception in .java

The type javax.xml.rpc.Service cannot be resolved. It is indirectly referenced from required .class files

If still I proceed with the build, no error when while starting the server but class not found exception occurs at runtime.

How to make use of Liberty library or is any alternate way to solve.

Karikalan
  • 263
  • 2
  • 17

1 Answers1

2

JAX-RPC is not supported by Liberty. Only JAX-RS is supported. By referencing the jaxrpc.jar file you run with class conflicts since the JAX-RS feature is a dependency of the REST feature that is required by Worklight. The best way is to use JAX-RS for the implementation of your web service. Other solution is as you have tested to remove the classes in conflict from the jaxrpc.jar file.