简体   繁体   English

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

[英]remote debugging a jnlp application with eclipse

I'm debugging a jnlp application, and I used to be able to remote debug it through eclipse, but not anymore. 我正在调试一个jnlp应用程序,我曾经能够通过eclipse远程调试它,但现在不再了。

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; 问题是,当我附加eclipse调试器时,它会关闭并重新启动; 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 . 因为如果suspend = n,在调试器启动之前,jnlp进程会自行重新启动。

I've tried tracing it, but the option -XX:TraceSupport=true (and other variations I have tried) causes a jvm error. 我试过跟踪它,但选项-XX:TraceSupport = true(以及我尝试过的其他变体)会导致jvm错误。

I'm using fedora 11, Eclipse Java EE IDE for Web Developers. 我正在使用Fedora 11,Eclipse Java EE IDE for Web Developers。 (Build id: 20090621-0832) (构建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! 谢谢!

This blog post has environment variables you can set to debug jnlp. 这篇博文有你可以设置为调试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

My Boss found the answer: 我的老板找到了答案:

It appears that the “<property>” tags in the jnlp file are more restrictive with the newer JRE. 看来jnlp文件中的“<property>”标签对于较新的JRE更具限制性。 According to the Sun documentation : 根据Sun文档

“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." “对于不受信任的应用程序,JNLP文件中设置的系统属性只有在被认为是安全的时候才能由Java Web Start设置,或者如果属性名称以”jnlp“开头。 or "javaws.".” 或“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. 在重新编译并修复了一个希望无关的问题,其中换行符导致签名的APPLICATION.JNLP和launch.jnlp看起来不是“相同”,调试器现在正在工作。

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

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