Java EE6 应用程序Glassfish 3.0/Netbeans 6.8 中的 EJB?

发布于 2024-08-29 00:56:41 字数 772 浏览 0 评论 0原文

有人让这个配置工作吗? 最新的Netbeans,最新的Glassfish,我创建了一个EJB项目,也是一个EE应用程序。 EJB 本身构建并构建 EJB。部署到 Glassfish OK。 现在,当我想引用 EJB 时,我必须将 EJB jar 添加到 EE 应用程序路径,如果不这样做,代码将无法编译。 但是,EJB jar 被打包在 App jar 中,因此当我尝试将应用程序部署到 Glassfish 时,它会显示:

“java.lang.IllegalArgumentException: 类型为 [ejb] 和 type 的嗅探器 [appclient] 不应声明 同时存档。请检查 您的档案的包装”

我如何告诉 Netbeans 不要将 EJB 打包到应用程序 jar 中?或者问题出在其他地方?

顺便说一句。如果我从 JAR 中手动删除 EJB,那么应用程序就会 成功(使用asadmin部署),但是当我尝试使用appclient运行它时,我得到一个NullPointerException,

当然必须有一个解决方案,我认为Netbeans毕竟是用于Web应用程序开发的......

编辑:我发现了这个:

http://forums.netbeans.org/topic23499.html

其中列出了与我这样做是为了解决问题。

Has anyone got this configuration working?
Latest Netbeans, latest Glassfish, I created an EJB project, also an EE Application.
The EJB in itself builds & deploys to Glassfish OK.
Now when I want to reference the EJB, I have to add the EJB jar to the EE Application path, if I don't do this the code does not compile.
But, the EJB jar gets packaged in the App jar and as a result when I try to deploy the app to Glassfish it says:

"java.lang.IllegalArgumentException:
Sniffers with type [ejb] and type
[appclient] should not claim the
archive at the same time. Please check
the packaging of your archive"

How do I tell Netbeans NOT TO package the EJB in the App jar? Or is the problem somewhere else?

btw. if I remove the EJB manually from the JAR then the app deploys successfully (with asadmin deploy), but when I try to run it with appclient, I get a NullPointerException.

Surely there must be a solution to this, I thought Netbeans was for web application development after all...

Edit: I found this:

http://forums.netbeans.org/topic23499.html

Which lists exactly the same steps that I did to resolve the problem.

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

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

发布评论

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

评论(2

走野 2024-09-05 00:56:41

这是一个候选解决方案:
https://netbeans.org/bugzilla/show_bug.cgi?id=183488

这基本上表明 Glassfish v3 已严重损坏,并且无法工作。

Here is a solution candidate:
https://netbeans.org/bugzilla/show_bug.cgi?id=183488

Which basically says that Glassfish v3 is seriously broken, and it won't work.

会发光的星星闪亮亮i 2024-09-05 00:56:41

以下是我让它工作的方法:EJB 和 EE 应用程序必须打包在 EAR(项目)中,并且它们必须部署在 EAR 中。单独部署应用程序 jar 不起作用(至少对于 Netbeans 6.8 + Glassfish v3 不起作用)。

Here is how I got it to work: the EJB and the EE Application MUST BE packaged in an EAR (project), and they MUST BE deployed within the EAR. Deploying the application jar individually WILL NOT WORK (at least not with Netbeans 6.8 + Glassfish v3).

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