Apache Wink Accept() fails with NullPointerException

自作多情 提交于 2019-12-06 03:11:17

The problem is that initialization of Accept class does not actually happen, and the delegate field is null.

The RuntimeDelegate is an interface whose implementation should be specified in META-INF/service/javax.ws.rs.ext.RuntimeDelegate file which is searched on the class path.

wink-common.jar contains such a service file with the correct class name of the implementation but if some other service file with the same name is found on class path (on of the jars) before the correct one, we will have such a weird behavior.

The problem was that JAX-RS implementation provided by jboss 7 was conflicting with Apache Wink, we had to disable jboss impl completely by commenting the contents of module.xml under JBOSS_HOME\modules\system\layers\base\javax\ws\rs\api\main to stop loading the Jboss JAX-RS API and it worked fine

This error is caused by the jar file conflict.I deleted jetty.jar,jetty-util.jar and also deleted jsr305.jar,the REST API just work fine.

On WAS8.5 liberty profile, even after I removed the wink dependency causing the error, the error would not go away. It finally turned out that I needed to stop & start my server. The solution was posted at the very bottom of this link https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014940544

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!