如何调试Java Applet? [英] How do you debug Java Applets?

查看:468
本文介绍了如何调试Java Applet?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,唯一的信息是浏览器状态栏中的一行错误消息。



你知道如何获得堆栈跟踪例如?

解决方案

本文有点旧,但仍然是相关的(包括题为如何在Java插件中调试Applet的部分) / p>

编辑:或许更好的方法来获取堆栈跟踪是使用 Java插件控制台。如果您在该窗口中点击t,您将看到以下内容:


打印所有现有线程
组。显示的第一组是Group
main。 ac代表活跃计数;它
是线程组中的活动线程
及其子线程
组的总数。 agc代表活动组
计数;它是线程组的活动
子线程组的数量。
pri优先;它是线程组的
优先级。跟随
组主,其他线程组将
显示为组,其中名称
是与小程序关联的URL。
单独的线程列表将
显示线程名称,线程
优先级,如果线程还活着
,或者如果线程位于
进程中则销毁被破坏,并且守护进程
如果线程是一个守护线程。


最常用的其他命令从该控制台是0-5的跟踪级别:


这将设置跟踪级别的选项,如下一节所述,跟踪和记录。


从该页面,您将看到级别如下所示:



<

  • 0 - off

  • 1 - 基本

  • 2 - 网络,缓存,和基本的

  • 3 - 安全,网络和基本的

  • 4 - 扩展,安全,网络和基本的

  • 5 - LiveConnect,扩展,安全,网络,临时和基本的


这些工具可以非常有用,因为您正在尝试解开世界上已经进入您的小程序的头脑的内容。我知道他们为我工作。


Currently, the only information I have is a one-line error message in the browser's status-bar.

Do you know how I could get a stack-trace for example ?

解决方案

This article is a bit old but is still relevant (including a section entitled "How to Debug Applets in Java Plug-in").

Edit: perhaps a better way to get stacktraces is to use the Java plugin console. If you hit "t" in that window, you'll see the following:

Prints out all the existing thread groups. The first group shown is Group main. ac stands for active count; it is the total number of active threads in a thread group and its child thread groups. agc stands for active group count; it is the number of active child thread groups of a thread group. pri stands for priority; it is the priority of a thread group. Following Group main, other thread groups will be shown as Group , where name is the URL associated with an applet. Individual listings of threads will show the thread name, the thread priority, alive if the thread is alive or destroyed if the thread is in the process of being destroyed, and daemon if the thread is a daemon thread.

The other command that I've used most often from that console is the trace level from 0-5:

This sets the trace-level options as described in the next section, Tracing and Logging.

From that page, you'll see that the levels look like this:

  • 0 — off
  • 1 — basic
  • 2 — network, cache, and basic
  • 3 — security, network and basic
  • 4 — extension, security, network and basic
  • 5 — LiveConnect, extension, security, network, temp, and basic

These tools can all be fairly useful as you're trying to unravel what in the world has gotten into the head of your applets. I know that they've worked for me.

这篇关于如何调试Java Applet?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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