使用 Easyrest 时应该如何访问 EJB?

发布于 2024-09-05 11:04:11 字数 301 浏览 2 评论 0原文

我一直在努力让 Resteasy 工作(而不是剂量)。然而,我现在又对访问 EJB:s 感到头疼。我尝试过注入它们,使用 jndi 和大多数其他解决方案查找它们,但它们都不起作用。

我得到的信息如下: java.lang.RuntimeException:类不是根资源。

或者:java.lang.IllegalArgumentException:目标错误。

或者只是:NullPointer

使用 JBoss 5.1.0.GA 和 Resteasy 1.2.1.GA... 找不到任何有关如何完成此操作的文档。有人知道吗?

I have been trying to get Resteasy to work (and not it dose). However I now have another headache with accessing the EJB:s. I have tried injecting them, looking them up with jndi and most other solutions but none of them works.

I get massages like: java.lang.RuntimeException: Class is not a root resource.

Or: java.lang.IllegalArgumentException: Wrong target.

Or just: NullPointer

Using JBoss 5.1.0.GA and Resteasy 1.2.1.GA... Can't find any documentation on how this could be done. Do anybody know?

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

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

发布评论

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

评论(1

奈何桥上唱咆哮 2024-09-12 11:04:11

您是否看过以下内容:EJB 集成

Resteasy 目前仅与 EJB 进行简单集成。要使 EJB 成为 JAX-RS 资源,您必须使用 JAX-RS 注释来注释 SLSB 的 @Remote 或 @Local 接口:

接下来,在 RESTeasy 的 web.xml 文件中,您必须使用resteasy.jndi.resources 手动向 RESTeasy 注册 EJB

Have you seen this: EJB Integration?

Resteasy currently only has simple integration with EJBs. To make an EJB a JAX-RS resource, you must annotate an SLSB's @Remote or @Local interface with JAX-RS annotations:

Next, in RESTeasy's web.xml file you must manually register the EJB with RESTeasy using the resteasy.jndi.resources

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