gxt + Java EE 托管模式
我正在尝试开发一个 Java EE + gxt 应用程序。我有一个 rpc 调用,它调用会话 bean 的方法。 如果我编译该项目并在浏览器中运行它,它工作正常,但是当我使用 托管模式我得到这样的异常:(为可读性而编辑)
分派传入 RPC 调用时出现异常
...
引起:java.lang.NullPointerException:org.Pecc.server.services.AppServiceImpl 处为 null。 getUserEmailByName(AppServiceImpl.java:53)
第 53 行是:
return appSessionBeanBean.getUserEmailByName(name);
就像无法访问会话 bean 一样。请注意,我有 GWT4NB 插件并使用它的“GWT 托管模式(w/oa Java EE 服务器)”命令,但我正在运行 glassfish 并在其中部署了 ejb 模块。工作难道还不够吗?如果我没记错的话,我曾经能够在托管模式下使用我的 ejb 模块。
有什么想法吗?
I'm trying to develop a Java EE + gxt application. I have an rpc call which calls a session bean's method.
If I compile the project and run it in the browser, it works fine, but when I use
hosted mode I get an exception like this: (edited for readability)
Exception while dispatching incoming RPC call
...
Caused by: java.lang.NullPointerException: null at org.Pecc.server.services.AppServiceImpl.
getUserEmailByName(AppServiceImpl.java:53)
Line 53 is:
return appSessionBeanBean.getUserEmailByName(name);
It's like the session bean can't be reached. Note that I have GWT4NB plugin and use it's "GWT hosted mode (w/o a Java EE server)" command, but I have glassfish running and the ejb module deployed in it. Shouldn't it be enough to work? If I remember right, I was able to use my ejb module in hosted mode at some point.
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不想问这个,但是你能够调试并确认 appSessionBeanBean 确实不为空吗?如果没有,则使用日志语句...
I hate to ask this, but are you able to debug and confirm the appSessionBeanBean is indeed not null? And if not, with log statements...
我找到了一种解决方法,将托管模式浏览器重定向到 glassfish 中部署的模块。我只是将 localhost:8080/EasyTicket-web 写入地址栏,而不是 localhost:8888 (jetty 的端口)。当然,必须启动 glassfish 才能发挥作用。
I found a workaround by redirecting the hosted mode browser to the module deployed in glassfish. I simply write localhost:8080/EasyTicket-web into the address bar instead of localhost:8888 (jetty's port.). Of course, glassfish has to be started for that to work.