Seam - Web 模块/WAR 中的 EJB3?

发布于 2024-09-13 07:02:17 字数 677 浏览 6 评论 0原文

我正在使用 Seam 2.2.x 编写一个应用程序,该应用程序将部署在 JBoss 5.1 上。我有一个 EJB 模块,其中包含 EJB 的所有业务逻辑。不过,我还希望在 Web 模块中使用无状态会话 EJB 来充当操作类。这可能吗?我需要执行任何额外的配置才能使其正常工作吗?我已经定义了一个接口:

@Local
public interface ContentItemSearchAction extends Serializable {
     ...
}

...和一个实现类...

@Name("contentItemSearchAction")
@AutoCreate
@Stateless
public class ContentItemSearchActionBean implements ContentItemSearchAction {
     ...
}

但是,当我尝试在 JSF 视图之一中访问 EJB 时,出现以下异常:

Caused by javax.naming.NameNotFoundException with message: "ContentItemSearchActionBean not bound" 

以前有人见过这个吗?我缺少什么?为什么我的 WAR 模块中的 EJB 没有被拾取?

I'm writing an application using Seam 2.2.x which will be deployed on JBoss 5.1. I have an EJB module with all of the business logic en EJB's. However, I'd also like to have statless session EJBs in the web module to act as action classes. Is this possible? Do I need to perform any additional configuration to get this working? I have an interface I've defined:

@Local
public interface ContentItemSearchAction extends Serializable {
     ...
}

...and an implementing class...

@Name("contentItemSearchAction")
@AutoCreate
@Stateless
public class ContentItemSearchActionBean implements ContentItemSearchAction {
     ...
}

However, when I try to access the EJB in one of my JSF views, I get the following exception:

Caused by javax.naming.NameNotFoundException with message: "ContentItemSearchActionBean not bound" 

Has anyone seen this before? What am I missing? Why is the EJB in my WAR module not being picked up?

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

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

发布评论

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

评论(1

水波映月 2024-09-20 07:02:17

EJB 不进入 WAR 文件。它们被打包成 JAR,与 WAR 一起进入 EAR。

EJB 不必位于 WAR 中即可从 Web 层看到。

EJBs do not go into WAR files. They're packaged into JARs, which go into the EAR along with the WAR.

The EJBs need not be in the WAR to be visible from your web tier.

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