使用CDI和OSGI时出错

发布于 2024-12-27 23:55:06 字数 495 浏览 1 评论 0原文

我正在尝试使用 JSF、Glassfish、OSGI 和 CDI 开发一个简单的登录表单。这是源代码: http://www.2shared.com/file/45Jdr1iu/NetBeansProjects.html 问题是,当我将 beans.xml 文件添加到 WEB-INF 目录中时,我将此错误堆栈放入 Glassfish 日志文件中。

http://pastebin.com/3KX5ir90

修复此 CDI 问题非常重要,因为当我尝试执行以下操作时,我会收到 NPE从 OSGI 包中调用方法。当我尝试从网络浏览器打开页面时,我得到空白页面。

您能帮我找到问题所在以便我解决它吗?

最好的祝愿, 彼得

I'm trying to develop a simple login form with JSF, Glassfish, OSGI and CDI. This is the source code:
http://www.2shared.com/file/45Jdr1iu/NetBeansProjects.html
The problem is that when I add beans.xml file into WEB-INF directory I get this error stack into Glassfish log file.

http://pastebin.com/3KX5ir90

It's very important to fix this CDI issue because I get NPE when I try to call method from the OSGI bundle. When I try to open the page from the web browser I get empty page.

Would you help me to find the problem so I can fix it, please?

Best wishes,
Peter

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

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

发布评论

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

评论(1

-黛色若梦 2025-01-03 23:55:06

你有一些例外,其中之一是 ClassNotFoundException,可能与 OSGI 包中的范围和可见性有关(我不是 OSGI 专家,仅供参考)。我还看到底部有一个 NonSerializedException 。这意味着您有一个 bean 位于必须可序列化的范围内(很可能是 SessionScoped 或 ConversationScoped),而该范围内的成员不可序列化或瞬态。

You have a few exceptions, one of them is a ClassNotFoundException, probably has something to do with the scopes and visibility in your OSGI bundle (I'm not an OSGI expert, FYI). I also saw a NonSerializableException towards the bottom too. Meaning you have a bean that is in a scope that must be serializable (SessionScoped or ConversationScoped most likely) which has a member that isn't serializable or transient.

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