需要帮助调试 GWT - Jetty“未知领域”
我正在尝试调试 GWT 应用程序,但似乎无法使用 jetty 来做到这一点。每当我尝试在托管模式下运行它进行调试时,我都会收到“未知领域”500 错误消息(没有加载任何内容)。我是通过 eclipse 来做到这一点的。事后必须编译所有内容才能在浏览器中进行调试,非常不方便。
编译后,我将 war 部署到 JBoss 中(在服务器上使用 EJB)。但编译需要时间,当代码变成 JavaScript 后,你就无法真正调试了。如何调试java代码?我正在研究 -noserver 选项,但我想知道我是否仍然可以使用 jetty 来做到这一点。如果没有,为什么不呢?
I am trying to debug a GWT application, but it seems I can't do it with jetty. Whenever I try to run it in hosted mode for debugging I get an 'unknown realm' 500 error message (nothing loads). I am doing this via eclipse. It is very uncovenient to have to compile everything to debug in the browser afterwards.
After compilation I deploy the war into JBoss (using EJB on the server). But compilation takes time and when the code has been turned into javascript, you can't really debug. How can I debug the java code? I am looking into the -noserver option, but I wonder if I could still do it with jetty. And if not, why not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的问题有两点:
web.xml
中有一个
):请参阅 http://code.google.com/p/google -web-toolkit/issues/detail?id=4462#c5 (现在这个 bug 已修复,您只需将userRealm
放入jetty-web.xml
并且您现在可以在web.xml
中使用
)-noserver
来调试 GWT 代码:使用-noserver
您将不会在 DevMode 中使用嵌入式 Jetty,因此只有您的客户端代码会在 DevMode 中运行。您的服务器端代码将在部署应用程序的服务器内运行,您将像调试任何其他 Java 服务器端代码一样对其进行调试(即以调试模式启动 JBoss 服务器并远程连接到它) 使用 Java 调试器)。要使用-noserver
,您必须确保您的服务器提供.nocache.js
和hosted.html
文件,方法是先编译您的 GWT 代码并部署它,或者使用服务器的应用程序文件夹作为 DevMode 的-war
(因此 DevMode 将在 Web 服务器提供文件的同一文件夹中生成文件)There are two points in your question:
<login-config>
in yourweb.xml
): see http://code.google.com/p/google-web-toolkit/issues/detail?id=4462#c5 (now that this bug is fixed, you only have to put theuserRealm
in thejetty-web.xml
and you can now use<login-config>
in yourweb.xml
)-noserver
to debug GWT code: using-noserver
you won't be using the embedded Jetty in DevMode, so only your client-side code will run in DevMode. Your server-side code will run within the server where you deployed the app, and you'll debug it as you would debug any other Java server-side code (i.e. launch your JBoss server in debug mode and connect to it remotely with a Java debugger). To use-noserver
you have to make sure the.nocache.js
andhosted.html
files are served by your server, either by first compiling your GWT code and deploying it, or by using your server's app folder as the-war
of the DevMode (so DevMode will generate the files in the same folder as the web server serves files from)您能介绍一下背景吗?您是否刚刚开始这个项目,或者它正在运行,然后出现了问题?您的运行配置命令是吗?
编辑
Could you give a little background? Did you just started up this project or was it working and then something went wrong? Are are your run configs commands?
EDIT