如何在jboss上调试GWT客户端代码 [英] How to debug GWT client side code on jboss

查看:93
本文介绍了如何在jboss上调试GWT客户端代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从GWT和smartgwt开始,并且我意识到,当您的代码在jetty上工作时,不一定适用于Jboss。

有什么方法可以调试异常或任何类型的错误:当客户端上的某些内容失败时,jboss控制台什么都没说。我想知道是否可以在应用程序运行时使用jetty窗口。



我使用Netbeans,jboss 5.1



更新:



感谢您的帮助,我一直使用 com .google.gwt.logging.Logging ,它工作的很好,但我正在寻找一种方法来调试客户端代码,例如使用netbeans。我知道如何调试服务器端代码,使用设置JAVA_OPTS = -Xdebug -Xrunjdwp:transport = dt_socket,address = 8787,server = y,suspend = y%JAVA_OPTS%然后我将netbeans调试器连接到8787端口。有没有办法从Jboss做类似的事情来调试客户端?



另外我知道如何使用gwt:debug来调试客户端代码,但在这种情况下,我的应用程序并未在jboss上运行,正在jetty上运行。 b $ b

解决方案

我假设您已经正确设置了启动配置(将启动环境指向JBoss,而不是嵌入式Jetty)。如果你处于开发模式,你应该已经能够调试javacode。如果你想在生产中使用浏览器的开发工具调试客户端代码。

关于错误处理
有两种方法可以处理GWT客户端异常。


  1. 将它们登录到客户端
  2. 将它们发送到服务器并将它们记录在服务器端

我认为您在服务器端日志记录之后(事实上,这正是我们在生产模式中需要的)GWT具有定义良好的错误处理机制为客户端和服务器端。这些答案/帖子将帮助你正确设置你的GWT应用程序中的错误处理程序。



GWT中的7个异常处理技巧



在GWT中设置remoteLoggingServlet


I'm starting with GWT and smartgwt, and I realized that when your code works on jetty will no necessarily work on Jboss.

Is there a way that I can debug exceptions or any kind of error when something on the client side fails, the jboss console says nothing. I was wondering if I can get the jetty window attached to the app when it is running on jboss.

I'm using Netbeans, jboss 5.1

UPDATE:

Thanks for your help, I've been using com.google.gwt.logging.Logging and it works pretty nice, but I was looking a way to debug client side code, using netbeans for instance. I know how to debug server side code starting jboss with set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS% then I attach the netbeans debugger to the 8787 port. Is there a way to do something similar from Jboss to debug client side ?

Also I know how to debug client side code using gwt:debug, but in that case my app is not running on jboss is running on jetty.

解决方案

I assume you already have the launch configurations set up correctly (pointing the launch environment to JBoss instead of embedded Jetty). If you are in dev mode you should already be able to debug the javacode. If you want to debug the client side code in production use browser's dev tools.

Regarding error handling There are two ways which you can handle the GWT client side exceptions.

  1. Log them in the client side
  2. Send them to server and log them in the server side

I think you are after server side logging (in fact that's what we need in production mode) GWT has a well defined error handling mechanisms for both client and server side. These answers/posts will help you yo set up error handlers in your GWT app properly.

7 Tips for Exception Handling in GWT

Setup a remoteLoggingServlet in GWT

这篇关于如何在jboss上调试GWT客户端代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆