获取“shmemBase_attach 失败:系统找不到指定的文件”当尝试附加到小程序进行调试时
我使用的是netbeans 6.1。
我的 java 运行时设置中有以下内容:
-agentlib:jdwp=transport=dt_shmem,address=jdbconn,server=y,suspend=n
以及 netbeans 中的附加对话框中的以下内容:
调试器:JPDA 调试器
连接器:共享内存附加(通过共享内存附加到其他虚拟机)
传输:dt_shmem
名称:jdbconn strong>
我从 netbeans Wiki 上的 FaqDebuggingAppletRemotely 页面获取了上述设置。
该小程序位于一个 aspx 页面中(该小程序已签名,是一种通过客户端浏览器与遗留平台进行通信的方法,我确实是一名 C# 开发人员)。我已设法显示安全警告,这使我有机会附加到小程序,但每当我尝试附加时,我都会看到:
正在附加到 jdbconn
shmemBase_attach 失败:系统找不到 指定的文件
在 netbeans 的输出窗口中
。任何帮助感激不尽!
I'm using netbeans 6.1.
I've got the following in my java run time settings:
-agentlib:jdwp=transport=dt_shmem,address=jdbconn,server=y,suspend=n
and the following in the attach dialog in netbeans:
Debugger: JPDA Debugger
Connector: Shared Memory Attach (Attaches by shared memory to other VMs)
Transport: dt_shmem
Name: jdbconn
I got the above settings from the FaqDebuggingAppletRemotely page on the netbeans Wiki.
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:
Attaching to jdbconn
shmemBase_attach failed: The system cannot find the file specified
in the output window in netbeans.
Any help gratefully received!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我敢打赌(几乎任何东西……至少可能是几美元,或者一块 cookie),您的小程序运行的 JVM 安装与您系统上安装的默认 JVM 安装不同。
要查找您的浏览器和小程序在 Windows 7 中使用的 JVM 安装:
1) 关闭所有使用 JVM 的应用程序(尤其是浏览器)。
2)打开Windows任务管理器(CTRL+ALT+DELETE->任务管理器),然后单击进程选项卡。
3) 确保没有任何 java*.exe 进程正在运行。
4) 打开浏览器并进入小程序页面,然后再次启动小程序。
5) 现在返回到“任务管理器”->“进程”选项卡,查找正在运行的 java*.exe(它很可能是“java.exe *32”,因为它实际上有一个星号)如果您没有看到该进程的名称,则只需使用正在运行的进程名称)。
6) 右键单击该进程,然后在上下文菜单中选择“打开文件位置”。这应该会将您带到浏览器用来运行小程序的已安装 JVM 的“bin”文件夹位置!您是否感到惊讶,它与您想象的不一样?
在 Linux 或其他系统上查找任务:
我只在 Windows 上遇到过这个问题,但无论如何,您可以按照以下方法进行操作。
打开 shell,输入以下内容
并记下 pid。
现在您已经知道您的小程序正在使用哪个 JVM:
我们需要打开该特定安装的 Java 控制台(而不是我们之前尝试修改的默认安装)。
要打开小程序正在使用的 JVM 安装的控制台,并设置运行时参数:
1) 在 JVM 安装的 bin 文件夹中打开命令提示符(shell 或其他)。 (在 Windows 7 中,您可以在资源管理器中按住 Shift 键并右键单击 bin 文件夹,然后选择“在此处打开命令提示符”)。
2) 运行以下命令打开控制台:
这也会最终打开“Java Cache Viewer”窗口,但我们不需要该窗口。关闭该窗口,但保持“Java 控制面板”窗口打开。
3) 现在,您可以转到 Java 选项卡,单击视图,然后像以前一样修改运行时参数:
4) 单击“确定”,然后单击主 Java 控制台窗口中的“应用”以应用并保存所有内容你所做的改变。
5)等等!我建议你做最后一件事;清除 java WebStart 缓存以确保您的小程序使用新参数下载最新版本:
请确保在您的小程序正在使用的 JVM 安装的 bin 目录中运行此命令,因为这可能与指向的 bin 目录不同通过您的 Path(或 PATH)系统环境变量。
现在从浏览器启动您的小程序,并在 NetBeans IDE 中创建另一个共享内存连接!在您正在调试的正确源代码中设置断点(NetBeans 中的“源”选项卡),然后开始使用您的小程序。您现在应该看到 Netbeans 正在突破您的断点!
至少,我希望如此...
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.
To find the JVM installation that your browser and applets are using in Windows 7:
1) Close all applications that use the JVM (especially the browser).
2) Open the windows task manager (CTRL+ALT+DELETE->Task Manager), and click on the processes tab.
3) Make sure there are not any java*.exe processes running.
4) Open your browser and go to the applets page, and start the applet up again.
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) 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?
To find the task on linux or other systems:
I've only ever had this problem on Windows, but here's how you do it anyhow.
Open a shell, and type the following
And make a note of the pid(s).
Now that you know which JVM your applets are using:
We need to open the Java Console for that partivular installation (as opposed to the default installation we tried to modify before).
To open the Console of the JVM installation that your applets are using, and set the runtime parameters:
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) Run the following command to open the console:
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) You can now go to the Java tab, click on view, and modify the runtime parameters just as you did before:
4) Click "OK", and then click "Apply" in the main java console window to apply and save all the changes you made.
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:
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.
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...
当您使用共享内存选项 (transport=dt_shmem) 进行调试时,您将使用 Windows 内部共享内存对象在调试器和 jvm 之间进行通信。
这意味着如果您
:不在与 jvm 相同的物理机器上进行调试,或者
b.不适用于 Windows 操作系统,
您无法在此模式下进行调试。
我不确定如果您在 Linux 工作站上的虚拟机上运行 Window 会发生什么...可能有效,也可能无效。
如果以上两者都没有问题,则需要进行更深入的调查才能找出问题,但同时,您可以使用普通套接字进行连接。
在 Java 运行时参数中指定:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=y
这告诉您的 jvm 以调试模式运行,加载 jdwp 库,等待连接连接到端口8000,并暂停执行,直到这样的连接到达。
在 IDE 中相应地设置远程调试器。我不知道 Netbeans,但它会类似于 Connector = 套接字连接器,地址=8000。
当您启动网页时,小程序将冻结加载,直到您连接为止,当然,在它到达侦听阶段之前您无法连接。
祝你好运!
When you debug with the shared memory option (transport=dt_shmem), you're using Windows internal shared memory objects to communicate between the debugger and the jvm.
This means that if you're:
a. Not debugging from the same physical machine as your jvm, or
b. Not working on a Windows OS,
You can not debug in this mode.
I'm not sure what would happen if you ran a Window on a VM on a Linux station...Might work and might not.
If both of the above are fine, it would require a deeper investigation to find out the problem, but in the mean time, you could attach with a plain socket.
In the Java run time parameters specify:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=y
This tells your jvm to run in debug mode, load the jdwp library, wait for connection to attach in port 8000, and suspend execution until such a connection arrives.
In your IDE set the remote debugger accordingly. I don't know Netbeans, but it would be something like Connector = socket connector, address=8000.
When you start your web page, the applet will freeze loading until you connect, and of course you can't connect until it has reached the listening stage.
Good luck!