Weblogic 10.3.1 给出“依赖注入失败”;发布代码时发出警告

发布于 2024-08-11 04:22:04 字数 503 浏览 3 评论 0原文

当我发布代码时,Weblogic 10.3.1 给出了“依赖注入失败”;发布本身成功。我正在通过 Eclipse 工作。

基本上,我发布了一个带有 Web 服务 aaa.MyWebServicePort 的 Ear,该服务具有一个使用 ejb 3.0 @EJB 注释声明为局部变量的 bean bbb.MyBean。 bbb.MyBean 以及已定义接口的客户端项目也在耳中。

发布后,Web 服务在应用程序服务器上运行并调用 bbb.MyBean。那么为什么会出现警告呢?

Eclipse 控制台窗口中警告的详细信息:创建名称为“aaa.MyWebServicePort”的 bean 时出错:bean 初始化失败;嵌套异常是[...] BeanCreationException:依赖注入失败:找不到有关类接口 bbb.MyBean 的 bean 定义;嵌套异常是 [...] NoSuchBeanDefinitionException:没有定义 bbb.MyBean 类型的唯一 bean:没有 bbb.MyBean 类型的 bean;

Weblogic 10.3.1 gives me a "Dependency injection failure" when I publish my code; the publish itself succeeds. I am working via Eclipse.

Basically I publish an ear with a web service aaa.MyWebServicePort that has a bean bbb.MyBean declared as local variable with the ejb 3.0 @EJB annotation. bbb.MyBean is also in the ear as well as a client project with the interfaces defined.

After publishing the web service works on the appserver and calls bbb.MyBean. So why the warning?

Details of the warning in the console window of Eclipse: Error creating bean with name 'aaa.MyWebServicePort': Initialization of bean failed; nested exception is [...] BeanCreationException: Dependency injection failure: can't find the bean definition about class interface bbb.MyBean; nested exception is [...] NoSuchBeanDefinitionException: No unique bean of type bbb.MyBean is defined: No beans of type bbb.MyBean;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沫雨熙 2024-08-18 04:22:04

这里可能存在一些工作问题。我在一个直接 servlet 中遇到了非常相似的错误,该 servlet 试图加载未打包在同一耳朵中的 ejb,我仍在尝试追踪该错误。我还知道加载 EJB v2.x 时存在一个困难,该困难应该在 Weblogic 10.3.3 中修复。
如果您发现任何问题,请告诉我,我也会这样做。我注意到的一件事是,如果我通过initialContext.lookup 加载EJB,它工作得很好。

青年MMV

There may be a couple of issues at work here. I'm getting a very similar error in just a straight servlet that is trying to load an ejb that isn't packaged in the same ear, I'm still trying to track that down. I also know that there is a difficulty when loading EJB v2.x that is supposed to be fixed in Weblogic 10.3.3.
If you find anything please let me know, and I'll do the same. One thing I have noticed is that if I load the EJB via initialContext.lookup, it works fine.

YMMV

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文