尝试附加到小程序进行调试时,获取“shmemBase_attach 失败:系统找不到指定的文件" [英] Getting 'shmemBase_attach failed: The system cannot find the file specified' when trying to attach to applet to debug

查看:24
本文介绍了尝试附加到小程序进行调试时,获取“shmemBase_attach 失败:系统找不到指定的文件"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 netbeans 6.1.

I'm using netbeans 6.1.

我的 java 运行时设置中有以下内容:

I've got the following in my java run time settings:

-agentlib:jdwp=transport=dt_shmem,address=jdbconn,server=y,suspend=n

以及 netbeans 附加对话框中的以下内容:

and the following in the attach dialog in netbeans:

调试器:JPDA 调试器

连接器:共享内存连接(通过共享内存连接到其他虚拟机)

交通:dt_shmem

名称:jdbconn

我从 netbeans Wiki 上的 FaqDebuggingAppletRemotely 页面获得了上述设置.

I got the above settings from the FaqDebuggingAppletRemotely page on the netbeans Wiki.

小程序位于 aspx 页面中(小程序已签名,是一种通过客户端浏览器与旧平台进行通信的方法,我真的是 C# 开发人员).我设法显示了安全警告,这让我有机会附加到小程序,但每当我尝试附加时,我都会看到:

The applet is in an aspx page (the applet, whcih is signed, is a method of communicating via the client browser to a legacy platform, I'm a C# developer really). I've managed to get the security warning to display which gives me a chance to attach to the applet but whenever I try to attach I see:

附加到 jdbconn

shmemBase_attach failed: 系统找不到指定的文件

在 netbeans 的输出窗口中.

in the output window in netbeans.

感谢收到任何帮助!

推荐答案

我敢打赌任何东西(几乎任何东西......至少可能是几美元,或者一个 cookie)你的小程序运行的 JVM 安装不是与系统上安装的默认 JVM 安装相同.

I would bet anything (almost anything ... maybe a few dollars at least, or a cookie) that the JVM installation your applets are running on is NOT the same as the default JVM installation that is installed on your system.

要查找您的浏览器和小程序在 Windows 7 中使用的 JVM 安装:

1) 关闭所有使用 JVM 的应用程序(尤其是浏览器).

1) Close all applications that use the JVM (especially the browser).

2) 打开windows任务管理器(CTRL+ALT+DELETE->任务管理器),点击进程标签.

2) Open the windows task manager (CTRL+ALT+DELETE->Task Manager), and click on the processes tab.

3) 确保没有任何 java*.exe 进程正在运行.

3) Make sure there are not any java*.exe processes running.

4) 打开浏览器并转到小程序页面,然后再次启动小程序.

4) Open your browser and go to the applets page, and start the applet up again.

5) 现在返回到任务管理器->进程选项卡并查找正在运行的 java*.exe(它很可能是java.exe *32"字面意思,因为它字面上会有一个进程名称中的星号.如果您没有看到那个,那么就使用正在运行的那个).

5) Now go back to the Task Manager->Processes tab and look for the java*.exe that is now running (it will most likely be "java.exe *32" literally, as in it will literally have an asteriks in the name of the process. If you don't see that one, then just use whichever one IS running).

6) 右键单击​​该进程,然后在上下文菜单中选择打开文件位置".这应该会将您带到已安装的 JVM 的bin"文件夹位置,您的浏览器将使用该文件夹来运行您的小程序!您是否对它与您想象的不一样感到惊讶?

6) Right click on that process, and in the context menu select "Open File Location". This should bring you to the "bin" folder location of the installed JVM that your browser is using to run your applets! Are you surprised that it is not the same as what you thought it would be?

在 linux 或其他系统上查找任务:

我只在 Windows 上遇到过这个问题,但无论如何你都可以这样做.

I've only ever had this problem on Windows, but here's how you do it anyhow.

打开一个shell,然后输入以下内容

Open a shell, and type the following

ps -e | grep java

并记下 pid.

现在您知道您的小程序使用的是哪个 JVM:

我们需要为该部分安装打开 Java 控制台(而不是我们之前尝试修改的默认安装).

We need to open the Java Console for that partivular installation (as opposed to the default installation we tried to modify before).

打开您的小程序正在使用的 JVM 安装控制台,并设置运行时参数:

To open the Console of the JVM installation that your applets are using, and set the runtime parameters:

1) 在 JVM 安装的 bin 文件夹中打开命令提示符(shell 或其他).(在 Windows 7 中,从资源管理器中,您可以通过 shift+右键单击 bin 文件夹,然后选择在此处打开命令提示符").

1)Open a command prompt (shell or whatever) in the bin folder of the JVM installation. (In windows 7, from the explorer, you can shift+right-click on the bin folder, and select "Open Command Prompt Here").

2) 运行以下命令打开控制台:

2) Run the following command to open the console:

    javaws -viewer

这也最终打开了我们不需要的Java Cache Viewer"窗口.关闭该窗口,但保持Java 控制面板"窗口打开.

This also ends up opening the "Java Cache Viewer" window, which we do not need. Close that window, but keep the "Java Control Panel" window open.

3) 您现在可以转到 Java 选项卡,单击查看,然后像以前一样修改运行时参数:

3) You can now go to the Java tab, click on view, and modify the runtime parameters just as you did before:

    -agentlib:jdwp=transport=dt_shmem,address=jdbconn,server=y,suspend=n

4) 单击确定",然后在主 Java 控制台窗口中单击应用"以应用并保存您所做的所有更改.

4) Click "OK", and then click "Apply" in the main java console window to apply and save all the changes you made.

5) 等等!我建议你做最后一件事;清除 java WebStart 缓存以确保您的小程序使用新参数下载新鲜:

5) WAIT! There is one last thing that I suggest you do; clear out the java WebStart cache to make sure your applets download fresh using the new parameters:

    javaws -uninstall

确保并在您的小程序使用的 JVM 安装的 bin 目录中运行它,因为这可能与您的 Path(或 PATH)系统环境变量指向的 bin 目录不同.

Be sure and run this in the bin directory of the JVM installation that your applets are using, since this might not be the same bin directory that is pointed to by your Path (or PATH) system environment variable.

现在从浏览器启动小程序,并在 NetBeans IDE 中创建另一个共享内存连接!在您正在调试的正确源代码中设置断点(NetBeans 中的源"选项卡),然后开始使用您的小程序.您现在应该看到 Netbeans 正在突破您的断点!

Now start up your applet from your browser, and create another shared memory connection inside your NetBeans IDE! Setup break points in the correct source code you are debugging ("source" tab in NetBeans), and start using your applet. You should now see that Netbeans is breaking on your break points!

至少,我希望如此......

At least, I hope so...

这篇关于尝试附加到小程序进行调试时,获取“shmemBase_attach 失败:系统找不到指定的文件"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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