Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
617 views
in Technique[技术] by (71.8m points)

java - A resource reference binding could not be found

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"?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...