不是调试对象,也不是正在侦听要附加的调试器(Not a debuggee or not listening for a debugger to attach)

编程入门 行业动态 更新时间:2024-10-28 21:31:18
不是调试对象,也不是正在侦听要附加的调试器(Not a debuggee or not listening for a debugger to attach)

我想将调试器附加到名为Mamute的github项目中。 run.sh连接应用程序。 cat run.sh读取:

#!/bin/bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" MAMUTE_DIR=$SCRIPT_DIR TIMESTAMP=BUILD_TIMESTAMP WEB_INF=${SCRIPT_DIR}/WEB-INF java -cp ${WEB_INF}/classes/:${WEB_INF}/lib/* \ -Ddeploy.timestamp=$TIMESTAMP \ -Dvraptor.webappdir=${MAMUTE_DIR} \ ${MAMUTE_OPTS} \ br.com.caelum.vraptor.server.Main \ not-grunt

我不知道“java -cp XXX”是什么意思。 我知道这是一个网络应用程序,所以我试着像我在Windows中使用visual studio调试东西一样附加到PID。

在使用“gksu / usr / bin / netbeans”启动netbeans之后,我转到顶层菜单> Debugger> Attach Debugger>

Java调试器(JPDA) 流程附件(通过pid) 运输=本地 PID = XXXX(运行“lsof -i:8080”获得的XXXX)

单击附加。 错误:

不是调试对象,也不是正在侦听要附加的调试器。

我正在运行Debian。

I want to attach a debugger to a github project called Mamute. run.sh wires up the application. cat run.shreads:

#!/bin/bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" MAMUTE_DIR=$SCRIPT_DIR TIMESTAMP=BUILD_TIMESTAMP WEB_INF=${SCRIPT_DIR}/WEB-INF java -cp ${WEB_INF}/classes/:${WEB_INF}/lib/* \ -Ddeploy.timestamp=$TIMESTAMP \ -Dvraptor.webappdir=${MAMUTE_DIR} \ ${MAMUTE_OPTS} \ br.com.caelum.vraptor.server.Main \ not-grunt

I don't know what "java -cp XXX" means. I know this is a web app so I tried to attach to the PID just like I would if I were debugging something in windows using visual studio.

After launching netbeans with "gksu /usr/bin/netbeans", I go to top menu > Debugger > Attach Debugger >

Java Debugger (JPDA) Process Attach (by pid) Transport = local PID = XXXX (XXXX obtained by running "lsof -i :8080)

Click Attach. Error:

Not a debuggee or not listening for a debugger to attach.

I'm running Debian.

最满意答案

在这里,您可以在调试模式下运行mamut,将以下选项添加到run.sh的java命令

-Xdebug -Xrunjdwp:transport=dt_socket,address=1000,server=y,suspend=n

然后,您必须在netbeans中选择dt_socket传输选项附加调试器。

请注意,如果suspend为'n',则应用程序将立即启动,不会等待调试器附加到它。 如果是'y',申请将被暂停,直到您附上申请。

Here you can run mamut in debug mode adding the following options to the java command in run.sh

-Xdebug -Xrunjdwp:transport=dt_socket,address=1000,server=y,suspend=n

You then have to attach the debugger in netbeans choosing the dt_socket transport option.

Note that, if suspend is 'n', the application will start immediately and will not wait for a debugger to attach to it. If 'y', the application will be suspended until you attach to it.

更多推荐

本文发布于:2023-07-27 10:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1289214.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对象   调试器   debuggee   attach   debugger

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!