A resource reference binding could not be found

我们两清 提交于 2019-11-28 11:09:02

问题


Currently I tried to upgrade a webservice system from Websphere 6 to Websphere 8.5. However I got this kind of issues

CWNEN0044E: A resource reference binding could not be found for the /wsContext resource reference, defined for the component.

Inside the source code, that part only contains

@Resource WebServiceContext wsContext;

This error will be gone if I switch class loader policy from parent last to parent first. However, do you know is there anyway to avoid this error with "parent last"?


回答1:


Your application must contain a JAR with the WebServiceContext class, which is preventing the server from recognizing this type as a "builtin" object for it to inject because you're using "parent last". If you must use "parent last", then your options are:

  1. Remove the JAR containing WebServiceContext from your application. This option assumes you need "parent last" in order to override some other class from the server but not webservices classes.

  2. Remove the @Resource annotation. This option assumes you are trying to override the webservice implementation. In that case, you can't rely on container injection.



来源:https://stackoverflow.com/questions/20798006/a-resource-reference-binding-could-not-be-found

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