使用 eclipse 远程调试 jnlp 应用程序

发布于 2024-08-10 01:56:04 字数 986 浏览 8 评论 0 原文

我正在调试一个 jnlp 应用程序,以前可以通过 eclipse 远程调试它,但现在不行了。

启动它的命令是:

 /usr/java/jdk1.6.0_14/jre/bin/java -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1445 -Djnlpx.heapsize=64m,512m -DtrustProxy=true -Xverify:remote -Djava.security.policy=/lib/security/javaws.policy -Dfile.encoding=UTF-8 -Xbootclasspath/a:/usr/java/jdk1.6.0_14/jre/lib/deploy.jar:/usr/java/jdk1.6.0_14/jre/lib/javaws.jar:/usr/java/jdk1.6.0_14/jre/lib/plugin.jar -classpath /usr/java/jdk1.6.0_14/jre/lib/deploy.jar com.sun.javaws.Main launch.jnlp
Listening for transport dt_socket at address: 1445

问题是,当我附加 Eclipse 调试器时,它会关闭并重新启动;所以调试器附加到第一个进程;当它死掉时,调试器也会死掉。

调试器脚本实际上并不重要;如果 suspend=n ,则 jnlp 进程会在调试器启动之前自行重新启动。

我尝试过跟踪它,但选项 -XX:TraceSupport=true (以及我尝试过的其他变体)会导致 jvm 错误。

我正在使用 fedora 11,即面向 Web 开发人员的 Eclipse Java EE IDE。 (版本号:20090621-0832)

我问是否有人知道如何解决这个问题,或者至少如何打开更好的日志记录(即,将所有控制台输出捕获到日志中;以便我可以查看第一个在我的屏幕上闪烁一毫秒的控制台)

谢谢!

I'm debugging a jnlp application, and I used to be able to remote debug it through eclipse, but not anymore.

the command to start it is:

 /usr/java/jdk1.6.0_14/jre/bin/java -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1445 -Djnlpx.heapsize=64m,512m -DtrustProxy=true -Xverify:remote -Djava.security.policy=/lib/security/javaws.policy -Dfile.encoding=UTF-8 -Xbootclasspath/a:/usr/java/jdk1.6.0_14/jre/lib/deploy.jar:/usr/java/jdk1.6.0_14/jre/lib/javaws.jar:/usr/java/jdk1.6.0_14/jre/lib/plugin.jar -classpath /usr/java/jdk1.6.0_14/jre/lib/deploy.jar com.sun.javaws.Main launch.jnlp
Listening for transport dt_socket at address: 1445

and the problem is that when I attach the eclipse debugger, it shuts down and restarts; so the debugger attaches to the first process; and when that dies so does the debugger.

the debugger script actually doesn't matter; as the jnlp process re-starts on its own before the debugger ever gets launched if suspend=n .

I've tried tracing it, but the option -XX:TraceSupport=true (and other variations I have tried) causes a jvm error.

I'm using fedora 11, Eclipse Java EE IDE for Web Developers. (Build id: 20090621-0832)

I'm asking if anyone knows how to fix this, or at least how to turn on better logging (ie, capture all the console output to a log; so that I can take a look at the first console that flashes up on my screen for a millisecond)

thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风筝在阴天搁浅。 2024-08-17 01:56:04

这篇博客文章包含您可以设置的环境变量调试jnlp。这一直对我有用。

  set JAVAWS_TRACE_NATIVE=1

  set JAVAWS_VM_ARGS=-Xdebug -Xnoagent -Djava.compiler=NONE 
            -Xrunjdwp:transport=dt_socket,address=8989,server=y,suspend=y
  javaws http://server:port/descriptor.jnlp

This blog post has environment variables you can set to debug jnlp. This has always worked for me.

  set JAVAWS_TRACE_NATIVE=1

  set JAVAWS_VM_ARGS=-Xdebug -Xnoagent -Djava.compiler=NONE 
            -Xrunjdwp:transport=dt_socket,address=8989,server=y,suspend=y
  javaws http://server:port/descriptor.jnlp
拍不死你 2024-08-17 01:56:04

我的老板找到了答案:

看来标签
jnlp 文件中的限制更多
使用较新的 JRE。根据
Sun 文档

“对于不受信任的应用程序,系统
JNLP 文件中设置的属性将
仅当以下情况时才由 Java Web Start 设置
被认为是安全的,或者如果
属性名称以“jnlp”开头。或者
“javaws。”。”

看起来像是不受信任的状态
导致应用程序启动
第二次用适当的
属性。

重新编译并修复了一个希望不相关的问题(换行符导致签名的 APPLICATION.JNLP 和 launch.jnlp 看起来不“相同”)后,调试器现在正在工作。

My Boss found the answer:

It appears that the “<property>” tags
in the jnlp file are more restrictive
with the newer JRE. According to the
Sun documentation:

“For an untrusted application, system
properties set in the JNLP file will
only be set by Java Web Start if they
are considered secure, or if the
property name begins with "jnlp." or
"javaws.".”

It looks like the untrusted status
causes the application to launch a
second time with the appropriate
properties.

after recompiling and fixing a hopefully unrelated issue where newlines were causing the signed APPLICATION.JNLP and the launch.jnlp to not appear to be "the same", the debugger is now working.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文