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

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

问题描述

我从 GWT 和 smartgwt 开始,我意识到当你的代码在 jetty 上工作时不一定在 Jboss 上工作.

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

当客户端出现故障时,有没有一种方法可以调试异常或任何类型的错误,jboss 控制台什么也没说.我想知道在 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.

我使用的是 Netbeans,jboss 5.1

I'm using Netbeans, jboss 5.1

更新:

感谢您的帮助,我一直在使用 com.google.gwt.logging.Logging 并且效果很好,但我正在寻找一种调试客户端代码的方法,使用 netbeans实例.我知道如何使用 set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS% 调试启动 jboss 的服务器端代码,然后我附加了 netbeans 调试器到 8787 端口.有没有办法从 Jboss 做类似的事情来调试客户端?

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 ?

我也知道如何使用 gwt:debug 调试客户端代码,但在这种情况下,我的应用程序没有在 jboss 上运行,而是在 jetty 上运行.

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.

推荐答案

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

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.

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

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

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

我认为您是在追求服务器端日志记录(实际上这是我们在生产模式下所需要的)GWT 为客户端和服务器端提供了一个明确定义的错误处理机制.这些答案/帖子将帮助您在 GWT 应用中正确设置错误处理程序.

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.

GWT中异常处理的7个技巧

在 GWT 中设置 remoteLoggingServlet

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

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