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

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你有一些例外,其中之一是 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.