oracle / visualvm

VisualVM is an All-in-One Java Troubleshooting Tool
https://visualvm.github.io/
Other
2.89k stars 305 forks source link

Cannot open requested application. #145

Open AnthonyJacob opened 5 years ago

AnthonyJacob commented 5 years ago

Describe the bug I installed intellij visualvm plugin. When I try to profile simple hello world, visualvm launches and raises an error: Cannot open requested application.

VisualVM log

-------------------------------------------------------------------------------
>Log Session: Tuesday, July 30, 2019 4:11:07 PM CEST
>System Info: 
  Product Version         = Java VisualVM
  Operating System        = Windows 10 version 10.0 running on amd64
  Java; VM; Vendor        = 1.8.0_181; Java HotSpot(TM) 64-Bit Server VM 25.181-b13; Oracle Corporation
  Runtime                 = Java(TM) SE Runtime Environment 1.8.0_181-b13
  Java Home               = C:\Program Files\Java\jdk1.8.0_181\jre
  System Locale; Encoding = en_US (visualvm); Cp1252
  Home Directory          = C:\Users\BlaineMono
  Current Directory       = F:\IntellijCommunity\IntelliJ IDEA Community Edition 2019.2\bin
  User Directory          = C:\Users\BlaineMono\AppData\Roaming\VisualVM\8u131
  Cache Directory         = C:\Users\BlaineMono\AppData\Local\VisualVM\Cache\8u131
  Installation            = C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\visualvm
                            C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\profiler
                            C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform
  Boot & Ext. Classpath   = C:\Program Files\Java\jdk1.8.0_181\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_181\jre\classes;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext\zipfs.jar
  Application Classpath   = C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\lib\boot.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\lib\org-openide-modules.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\lib\org-openide-util-lookup.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\lib\org-openide-util.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\lib\locale\boot_ja.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\lib\locale\boot_zh_CN.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\lib\locale\org-openide-modules_ja.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\lib\locale\org-openide-modules_zh_CN.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\lib\locale\org-openide-util-lookup_ja.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\lib\locale\org-openide-util-lookup_zh_CN.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\lib\locale\org-openide-util_ja.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\lib\locale\org-openide-util_zh_CN.jar;C:\Program Files\Java\jdk1.8.0_181\lib\dt.jar;C:\Program Files\Java\jdk1.8.0_181\lib\tools.jar
  Startup Classpath       = C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\core\core.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\core\org-openide-filesystems.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\core\locale\core_ja.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\core\locale\core_zh_CN.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\core\locale\org-openide-filesystems_ja.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform\core\locale\org-openide-filesystems_zh_CN.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\visualvm\core\com-sun-tools-visualvm-modules-startup.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\visualvm\core\locale\com-sun-tools-visualvm-modules-startup_ja.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\visualvm\core\locale\com-sun-tools-visualvm-modules-startup_zh_CN.jar;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\visualvm\core\locale\core_visualvm.jar
-------------------------------------------------------------------------------
INFO [org.netbeans.core.startup.NbEvents]: Turning on modules:
    org.openide.util.lookup [8.25.2 20170114-unknown-revn]
    org.openide.util [8.39.1 20170114-unknown-revn]
    org.openide.modules [7.43.1 20170114-unknown-revn]
    org.netbeans.api.annotations.common/1 [1.24.1 20170114-unknown-revn]
    org.openide.filesystems [8.12.1 20170114-unknown-revn]
    org.openide.awt [7.62.1 20170114-unknown-revn]
    org.netbeans.api.progress/1 [1.38.1 20170114-unknown-revn]
    org.openide.dialogs [7.38.1 20170114-unknown-revn]
    org.openide.nodes [7.39.1 20170114-unknown-revn]
    org.openide.windows [6.71.1 20170114-unknown-revn]
    org.netbeans.modules.editor.mimelookup/1 [1.36.1 20170114-unknown-revn]
    org.openide.text [6.62.2 20170114-unknown-revn]
    org.netbeans.swing.tabcontrol [1.51.1 20170114-unknown-revn]
    org.netbeans.swing.outline [1.30.1 20170114-unknown-revn]
    org.openide.explorer [6.57.1 20170114-unknown-revn]
    org.openide.actions [6.35.1 20170114-unknown-revn]
    org.netbeans.modules.queries/1 [1.39.1 20170114-unknown-revn]
    org.openide.loaders [7.57.2 20170114-unknown-revn]
    org.openide.io [1.45.1 20170114-unknown-revn]
    org.netbeans.swing.plaf [1.37.1 20170114-unknown-revn]
    org.netbeans.spi.quicksearch [1.23.1 20170114-unknown-revn]
    org.netbeans.bootstrap/1 [2.69.3 20170114-unknown-revn]
    org.netbeans.core.startup/1 [1.55.2 20170114-unknown-revn]
    org.netbeans.modules.settings/1 [1.45.1 20170114-unknown-revn]
    org.netbeans.modules.sendopts/2 [2.31.1 20170114-unknown-revn]
    org.netbeans.modules.sampler [1.10.1 20170114-unknown-revn]
    org.netbeans.modules.progress.ui [1.29.2 20170114-unknown-revn]
    org.netbeans.modules.profiler.utilities/1 [1.31.1 20170114-unknown-revn]
    org.netbeans.lib.profiler/1 [1.59.5 20170114-unknown-revn]
    org.netbeans.lib.profiler.charts/1 [1.25.1 20170114-unknown-revn]
    org.netbeans.lib.profiler.common/1 [1.32.1 20170114-unknown-revn]
    org.netbeans.modules.profiler.api/1 [1.19.1 20170114-unknown-revn]
    org.netbeans.lib.profiler.ui/1 [1.45.1 20170114-unknown-revn]
    org.netbeans.modules.keyring [1.20.1 20170114-unknown-revn]
    org.netbeans.core/2 [3.46.1 20170114-unknown-revn]
    org.netbeans.modules.options.api/1 [1.41.1 20170114-unknown-revn]
    org.netbeans.modules.profiler.selector.api/1 [1.29.1 20170114-unknown-revn]
    org.netbeans.modules.profiler.attach/2 [2.15.1 20170114-unknown-revn]
    org.netbeans.modules.profiler.selector.ui/1 [1.26.1 20170114-unknown-revn]
    org.netbeans.modules.profiler/2 [2.22.1 20170114-unknown-revn]
    org.netbeans.modules.profiler.snaptracer/1 [1.17.1 20170114-unknown-revn]
    org.netbeans.modules.profiler.oql/2 [2.12.1 20170114-unknown-revn]
    org.netbeans.modules.profiler.heapwalker [1.99.2 20170114-unknown-revn]
    org.netbeans.modules.masterfs/2 [2.48.3 20170114-unknown-revn]
    org.netbeans.modules.masterfs.nio2 [1.12.1 20170114-unknown-revn]
    org.netbeans.modules.keyring.fallback [1.4.1 20170114-unknown-revn]
    org.netbeans.modules.keyring.impl [1.20.1 20170114-unknown-revn]
    org.netbeans.modules.editor.mimelookup.impl/1 [1.27.1 20170114-unknown-revn]
    org.netbeans.modules.autoupdate.services [1.47.2 20170114-unknown-revn]
    org.netbeans.modules.autoupdate.ui [1.41.1 20170114-unknown-revn]
    org.netbeans.modules.autoupdate.cli [1.9.1 20170114-unknown-revn]
    org.netbeans.core.windows/2 [2.77.2 20170114-unknown-revn]
    org.netbeans.core.ui/1 [1.41.1 20170114-unknown-revn]
    org.netbeans.core.multitabs/1 [1.8.1.1 1 20170114-unknown-revn]
    com.sun.tools.visualvm.uisupport/0 [1.3 170114]
    com.sun.tools.visualvm.core/0 [1.6 170114]
    com.sun.tools.visualvm.host/0 [1.0 170114]
    com.sun.tools.visualvm.application/0 [1.9 170114]
    com.sun.tools.visualvm.tools/0 [1.4 170114]
    com.sun.tools.visualvm.coredump/0 [1.1 170114]
    com.sun.tools.visualvm.threaddump/0 [1.0 170114]
    com.sun.tools.visualvm.heapdump/0 [1.1 170114]
    com.sun.tools.visualvm.profiling/0 [1.3 170114]
    com.sun.tools.visualvm.sampler [2.1 170114]
    com.sun.tools.visualvm.sa/0 [1.1 170114]
    com.sun.tools.visualvm.modules.startup [1.1 170114]
    com.sun.tools.visualvm.profiler/0 [1.5 170114]
    com.sun.tools.visualvm.modules.appui [1.0 170114]
    com.sun.tools.visualvm.jvmstat/0 [1.0 170114]
    com.sun.tools.visualvm.jvm/0 [1.1 170114]
    com.sun.tools.visualvm.jmx/0 [1.4 170114]
    com.sun.tools.visualvm.charts/0 [1.5 170114]
    com.sun.tools.visualvm.host.views/0 [1.0 170114]
    com.sun.tools.visualvm.host.remote/0 [1.0 170114]
    com.sun.tools.visualvm.attach/0 [1.1 170114]
    com.sun.tools.visualvm.application.views/0 [1.0 170114]
INFO [org.netbeans.ui.metrics.laf]: USG_LOOK_AND_FEEL
Diagnostic information
Input arguments:
    -Xms24m
    -Xmx256m
    -Dsun.jvmstat.perdata.syncWaitMs=10000
    -Dsun.java2d.noddraw=true
    -Dsun.java2d.d3d=false
    -Dnetbeans.keyring.no.master=true
    -Dplugin.manager.install.global=false
    --add-exports=java.desktop/sun.awt=ALL-UNNAMED
    --add-exports=jdk.jvmstat/sun.jvmstat.monitor.event=ALL-UNNAMED
    --add-exports=jdk.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED
    --add-exports=java.desktop/sun.swing=ALL-UNNAMED
    --add-exports=jdk.attach/sun.tools.attach=ALL-UNNAMED
    --add-modules=java.activation
    -XX:+IgnoreUnrecognizedVMOptions
    -Djdk.home=C:\Program Files\Java\jdk1.8.0_181
    -Dnetbeans.home=C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\platform
    -Dnetbeans.user=C:\Users\BlaineMono\AppData\Roaming\VisualVM\8u131
    -Dnetbeans.default_userdir_root=C:\Users\BlaineMono\AppData\Roaming\VisualVM
    -XX:+HeapDumpOnOutOfMemoryError
    -XX:HeapDumpPath=C:\Users\BlaineMono\AppData\Roaming\VisualVM\8u131\var\log\heapdump.hprof
    -Dsun.awt.keepWorkingSetOnMinimize=true
    -Dnetbeans.dirs=C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\visualvm;C:\Program Files\Java\jdk1.8.0_181\lib\visualvm\profiler
Compiler: HotSpot 64-Bit Tiered Compilers
Heap memory usage: initial 24.0MB maximum 228.0MB
Non heap memory usage: initial 2.4MB maximum -1b
Garbage collector: PS Scavenge (Collections=8 Total time spent=0s)
Garbage collector: PS MarkSweep (Collections=1 Total time spent=0s)
Classes: loaded=5158 total loaded=5158 unloaded 0
INFO [org.netbeans.core.ui.warmup.DiagnosticTask]: Total memory 8,268,206,080
INFO [null]: Total physical memory 8,268,206,080
INFO [org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalogParser]: Unpaired license 9E0C2F2C without any module.
INFO [org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalogParser]: Unpaired license A1487945 without any module.
INFO [org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalogParser]: Unpaired license 5BFCC8E4 without any module.
WARNING [com.sun.tools.visualvm.jmx.impl.JmxModelImpl]: The JMX management agent cannot be enabled in this application (pid 5432)
INFO [com.sun.tools.visualvm.sa.SaModelProvider]: Error getting SA agent
sun.jvm.hotspot.debugger.DebuggerException: Windbg Error: WaitForEvent failed!
    at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.attach0(Native Method)
    at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.attach(WindbgDebuggerLocal.java:152)
    at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:671)
    at sun.jvm.hotspot.HotSpotAgent.setupDebuggerWin32(HotSpotAgent.java:569)
    at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:335)
    at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304)
    at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:140)
Caused: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.tools.visualvm.sa.SAObject.invoke(SAObject.java:87)
    at com.sun.tools.visualvm.sa.Agent.attach(Agent.java:44)
    at com.sun.tools.visualvm.sa.SaModelImpl.attach(SaModelImpl.java:98)
    at com.sun.tools.visualvm.sa.SaModelImpl.readData(SaModelImpl.java:106)
    at com.sun.tools.visualvm.sa.SaModelImpl.<init>(SaModelImpl.java:32)
[catch] at com.sun.tools.visualvm.sa.SaModelProvider.createModelFor(SaModelProvider.java:58)
    at com.sun.tools.visualvm.sa.SaModelProvider.createModelFor(SaModelProvider.java:26)
    at com.sun.tools.visualvm.core.model.ModelFactory.getModel(ModelFactory.java:91)
    at com.sun.tools.visualvm.tools.sa.SaModelFactory.getSAAgentFor(SaModelFactory.java:45)
    at com.sun.tools.visualvm.jvm.JVMImpl.getSAAgent(JVMImpl.java:467)
    at com.sun.tools.visualvm.jvm.JVMImpl.isGetSystemPropertiesSupported(JVMImpl.java:285)
    at com.sun.tools.visualvm.application.views.overview.ApplicationOverviewModel.initialize(ApplicationOverviewModel.java:180)
    at com.sun.tools.visualvm.application.views.overview.ApplicationOverviewModel.initialize(ApplicationOverviewModel.java:115)
    at com.sun.tools.visualvm.application.views.overview.ApplicationOverviewView.willBeAdded(ApplicationOverviewView.java:36)
    at com.sun.tools.visualvm.core.ui.DataSourceView.viewWillBeAdded(DataSourceView.java:172)
    at com.sun.tools.visualvm.core.ui.DataSourceWindowManager.addViews(DataSourceWindowManager.java:262)
    at com.sun.tools.visualvm.core.ui.DataSourceWindowManager.openWindowAndAddView(DataSourceWindowManager.java:187)
    at com.sun.tools.visualvm.core.ui.DataSourceWindowManager.access$000(DataSourceWindowManager.java:30)
    at com.sun.tools.visualvm.core.ui.DataSourceWindowManager$2.run(DataSourceWindowManager.java:97)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1384)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1994)
thurka commented 5 years ago

How long does your simple hello world application run? Maybe it no longer runs, when VisualVM starts. Does VisualVM works without Intellij visualvm plugin? Can you see your application when you run it from Intellij?

njasm commented 5 years ago

Im having the same issues with a long running application on Windows 10 pro. visualvm is started from the visualvm launcher intellij plugin.

Ill try to provide you more information tomorrow

mcooling commented 5 years ago

Did anyone find a solution to this? I have exactly the same issue running on both macOS and Win10, which would suggest an issue on the intelliJ/plugin side?

ofir-bar5 commented 4 years ago

Is there any news with that? I have the same issue, running macOS 10.15 Beta, on Android Studio 3.5.1

thurka commented 4 years ago

Is there any news with that? I have the same issue, running macOS 10.15 Beta, on Android Studio 3.5.1

We need steps to reproduce, to be able to diagnose this issue. Can you provide them?

draco-malfoy commented 4 years ago

Facing the same issue. Should i provide logs? or steps to reproduce perhaps

pyella commented 4 years ago

I had the same problem with visualvm while running from intellij, I already had an exe running and when I try to launch visualvm from intellij I faced the issue. However when I closed the local visual vm and only tried to launch via intellij I didn't face the issue.

ellnika commented 4 years ago

I have the same issue. Intellij Community 2020.1 As soon as Visual VM is launched "cannot open requested application". I use launcher plugin in Intellij to run. I found this post with some workarounds https://stackoverflow.com/questions/11891969/visualvm-launcher-error so it has been a problem for the last 7 years!!!!

Mehran-at commented 3 years ago

same problem for, getting warning when I start apps with visualvm! any solution so far ?

skyhirider commented 2 years ago

The solution for me was to run Idea as an Admin so that VisualVm had write rights to the %TMP%/hsperfdata_[username] folder.

I presume changing the permissions on that folder would work as well and you would no longer need to run Idea as admin.

Barney-x1 commented 2 years ago

The solution for me was to run Idea as an Admin so that VisualVm had write rights to the %TMP%/hsperfdata_[username] folder.

Neither running as administrator or changing permissions on that folder worked for me.