简体   繁体   English

需要帮助调试GWT - Jetty'未知领域'

[英]Need help debugging GWT - Jetty 'unknown realm'

I am trying to debug a GWT application, but it seems I can't do it with jetty. 我正在尝试调试GWT应用程序,但似乎我不能用jetty来做。 Whenever I try to run it in hosted mode for debugging I get an 'unknown realm' 500 error message (nothing loads). 每当我尝试在托管模式下运行它进行调试时,我都会得到一个'unknown realm'500错误消息(没有任何加载)。 I am doing this via eclipse. 我是通过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). 编译之后,我将war部署到JBoss中(在服务器上使用EJB)。 But compilation takes time and when the code has been turned into javascript, you can't really debug. 但是编译需要时间,当代码变成javascript时,你无法真正调试。 How can I debug the java code? 我该如何调试java代码? I am looking into the -noserver option, but I wonder if I could still do it with jetty. 我正在研究-noserver选项,但我想知道我是否还可以用jetty来做。 And if not, why not. 如果没有,为什么不呢。

There are two points in your question: 您的问题有两点:

  • using authentication in the embedded Jetty (I presume you have a <login-config> in your web.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 the userRealm in the jetty-web.xml and you can now use <login-config> in your web.xml ) 在嵌入式Jetty中使用身份验证(我假设您的web.xml<login-config> ):请参阅http://code.google.com/p/google-web-toolkit/issues/detail?id=4462 #c5 (现在修复了这个bug,你只需要将userRealm放在jetty-web.xml ,你现在可以在你的web.xml使用<login-config>
  • using -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. 使用-noserver调试GWT代码:使用-noserver您将不会在DevMode中使用嵌入式Jetty,因此只有您的客户端代码才能在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 (ie launch your JBoss server in debug mode and connect to it remotely with a Java debugger). 您的服务器端代码将在您部署应用程序的服务器中运行,您将调试它,就像调试任何其他Java服务器端代码一样(即以调试模式启动JBoss服务器并使用Java 远程连接它)调试器)。 To use -noserver you have to make sure the .nocache.js and hosted.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) 要使用-noserver ,你必须确保.nocache.jshosted.html文件由服务器供应,或者通过先编译GWT代码和部署它,或使用你的服务器的应用程序文件夹中-war在DEVMODE的(因此DevMode将在与Web服务器提供文件相同的文件夹中生成文件)

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 编辑

  • Please be more verbose (ie GWT version, complete error message, web.xml), need something to work on. 请更详细(即GWT版本,完整的错误消息,web.xml),需要处理一些事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM