找不到资源引用绑定 [英] A resource reference binding could not be found

查看:48
本文介绍了找不到资源引用绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我尝试将 Web 服务系统从 Websphere 6 升级到 Websphere 8.5.但是我遇到了这种问题

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

CWNEN0044E: 找不到为组件定义的/wsContext 资源引用的资源引用绑定.

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

@资源WebServiceContext wsContext;

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

推荐答案

您的应用程序必须包含一个带有 WebServiceContext 类的 JAR,这会阻止服务器将此类型识别为内置"对象因为你使用的是父最后",所以它被注入.如果您必须使用parent last",那么您的选择是:

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. 从您的应用程序中删除包含 WebServiceContext 的 JAR.此选项假定您需要最后一个父级"以覆盖来自服务器的其他类而不是网络服务类.

  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.

删除 @Resource 注释.此选项假定您正在尝试覆盖 Web 服务实现.在这种情况下,您不能依赖容器注入.

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.

这篇关于找不到资源引用绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆