oracle / visualvm

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

Cannot use "Export Snapshot Data" java.nio.file.NoSuchFileException #126

Closed folkvir closed 4 months ago

folkvir commented 5 years ago

Describe the bug I cannot export my snapshot in order to save him.

To Reproduce Steps to reproduce the behavior:

  1. Go to Profiler, start profiling CPU with as filter: mypackage.**
  2. Start my java application with the specified user agent
  3. Wait for the termination of my java application
  4. On termination, dialog ask me to create a snapshot, yes.
  5. Export snapshot with as name "snap" in specific folder
  6. See error (see screenshot)

Expected behavior No error and my snpashot well saved in the specified directory

VisualVM log

-------------------------------------------------------------------------------
>Log Session: Monday, February 25, 2019 at 4:58:46 PM Central European Standard Time
>System Info:
  Product Version         = VisualVM 1.4.2
  Operating System        = Mac OS X version 10.14.2 running on x86_64
  Java; VM; Vendor        = 11.0.1; OpenJDK 64-Bit Server VM 11.0.1+13; Oracle Corporation
  Runtime                 = OpenJDK Runtime Environment 11.0.1+13
  Java Home               = /Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home
  System Locale; Encoding = fr_FR (visualvm); UTF-8
  Home Directory          = /Users/grall-a
  Current Directory       = /Users/grall-a
  User Directory          = /Users/grall-a/Library/Application Support/VisualVM/1.4
  Cache Directory         = /Users/grall-a/Library/Caches/VisualVM/1.4
  Installation            = /Applications/VisualVM.app/Contents/Resources/visualvm/visualvm
                            /Applications/VisualVM.app/Contents/Resources/visualvm/profiler
                            /Applications/VisualVM.app/Contents/Resources/visualvm/platform
  Boot & Ext. Classpath   =
  Application Classpath   = /Applications/VisualVM.app/Contents/Resources/visualvm/platform/lib/boot.jar:/Applications/VisualVM.app/Contents/Resources/visualvm/platform/lib/org-openide-modules.jar:/Applications/VisualVM.app/Contents/Resources/visualvm/platform/lib/org-openide-util-lookup.jar:/Applications/VisualVM.app/Contents/Resources/visualvm/platform/lib/org-openide-util-ui.jar:/Applications/VisualVM.app/Contents/Resources/visualvm/platform/lib/org-openide-util.jar
  Startup Classpath       = /Applications/VisualVM.app/Contents/Resources/visualvm/platform/core/org-netbeans-libs-asm.jar:/Applications/VisualVM.app/Contents/Resources/visualvm/platform/core/asm-all-5.0.1.jar:/Applications/VisualVM.app/Contents/Resources/visualvm/platform/core/org-openide-filesystems.jar:/Applications/VisualVM.app/Contents/Resources/visualvm/platform/core/core.jar:/Applications/VisualVM.app/Contents/Resources/visualvm/platform/core/core-base.jar:/Applications/VisualVM.app/Contents/Resources/visualvm/visualvm/core/com-sun-tools-visualvm-modules-startup.jar:/Applications/VisualVM.app/Contents/Resources/visualvm/visualvm/core/locale/core_visualvm.jar
-------------------------------------------------------------------------------
INFO [org.netbeans.core.startup.NbEvents]: Turning on modules:
    org.openide.util.lookup [8.34 20180815-unknown-revn]
    org.openide.util [9.8 20180815-unknown-revn]
    org.openide.util.ui [9.8 20180815-unknown-revn]
    org.openide.modules [7.49 20180815-unknown-revn]
    org.netbeans.api.annotations.common/1 [1.28 20180815-unknown-revn]
    org.openide.filesystems [9.11 20180815-unknown-revn]
    org.openide.awt [7.68 20180815-unknown-revn]
    org.netbeans.api.progress/1 [1.48 20180815-unknown-revn]
    org.netbeans.api.progress.nb [1.48 20180815-unknown-revn]
    org.openide.dialogs [7.43 20180815-unknown-revn]
    org.openide.nodes [7.46 20180815-unknown-revn]
    org.openide.windows [6.77 20180815-unknown-revn]
    org.netbeans.modules.editor.mimelookup/1 [1.41 20180815-unknown-revn]
    org.openide.text [6.68 20180815-unknown-revn]
    org.netbeans.swing.tabcontrol [1.57 20180815-unknown-revn]
    org.netbeans.swing.outline [1.35 20180815-unknown-revn]
    org.openide.explorer [6.63 20180815-unknown-revn]
    org.openide.actions [6.40 20180815-unknown-revn]
    org.netbeans.modules.queries/1 [1.44 20180815-unknown-revn]
    org.netbeans.api.templates [1.9 20180815-unknown-revn]
    org.openide.filesystems.nb [9.11 20180815-unknown-revn]
    org.openide.loaders [7.67 20180815-unknown-revn]
    org.netbeans.api.intent [1.3 20180815-unknown-revn]
    org.netbeans.api.io [1.4 20180815-unknown-revn]
    org.openide.io [1.50 20180815-unknown-revn]
    org.netbeans.swing.plaf [1.42 20180815-unknown-revn]
    org.netbeans.spi.quicksearch [1.28 20180815-unknown-revn]
    org.netbeans.libs.asm [5.4 20180815-unknown-revn]
    org.netbeans.bootstrap/1 [2.77 20180815-unknown-revn]
    org.netbeans.core.startup.base [1.63.0.1 1 20180815-unknown-revn]
    org.netbeans.core.startup/1 [1.63.0.1 20180815-unknown-revn]
    org.netbeans.modules.settings/1 [1.50 20180815-unknown-revn]
    org.netbeans.modules.sendopts/2 [2.37 20180815-unknown-revn]
    org.netbeans.modules.sampler [1.15 20180815-unknown-revn]
    org.netbeans.modules.progress.ui [1.34 20180815-unknown-revn]
    org.netbeans.modules.profiler.utilities/1 [1.38 20180815-unknown-revn]
    org.netbeans.lib.profiler/1 [1.111 20180815-unknown-revn]
    org.netbeans.lib.profiler.charts/1 [1.31 20180815-unknown-revn]
    org.netbeans.lib.profiler.common/1 [1.50 20180815-unknown-revn]
    org.netbeans.modules.profiler.api/1 [1.51 20180815-unknown-revn]
    org.netbeans.lib.profiler.ui/1 [1.146 20180815-unknown-revn]
    org.netbeans.modules.keyring [1.25 20180815-unknown-revn]
    org.netbeans.core/2 [3.52 20180815-unknown-revn]
    org.netbeans.modules.options.api/1 [1.46 20180815-unknown-revn]
    org.netbeans.modules.profiler.attach/2 [2.23 20180815-unknown-revn]
    org.netbeans.core.windows/2 [2.83 20180815-unknown-revn]
    org.netbeans.modules.profiler/3 [3.32 20180815-unknown-revn]
    org.netbeans.modules.profiler.snaptracer/1 [1.25 20180815-unknown-revn]
    org.netbeans.modules.profiler.oql/2 [2.19 20180815-unknown-revn]
    org.netbeans.modules.profiler.heapwalker [1.113 20180815-unknown-revn]
    org.netbeans.modules.options.keymap [1.38 20180815-unknown-revn]
    org.netbeans.modules.masterfs/2 [2.56.0.2 2 20180815-unknown-revn]
    org.netbeans.modules.masterfs.ui [2.4.0.2 20180815-unknown-revn]
    org.netbeans.modules.masterfs.nio2 [1.16 20180815-unknown-revn]
    org.netbeans.libs.jna/1 [1.48 20180815-unknown-revn]
    org.netbeans.modules.masterfs.macosx [1.14 20180815-unknown-revn]
    org.netbeans.modules.keyring.fallback [1.9 20180815-unknown-revn]
    org.netbeans.modules.keyring.impl [1.25 20180815-unknown-revn]
    org.netbeans.modules.editor.mimelookup.impl/1 [1.33 20180815-unknown-revn]
    org.netbeans.modules.autoupdate.services [1.53 20180815-unknown-revn]
    org.netbeans.modules.autoupdate.ui [1.46 20180815-unknown-revn]
    org.netbeans.modules.autoupdate.cli [1.14 20180815-unknown-revn]
    org.netbeans.modules.applemenu/1 [1.38 20180815-unknown-revn]
    org.netbeans.libs.jna.platform/1 [1.16 20180815-unknown-revn]
    org.netbeans.core.ui/1 [1.46 20180815-unknown-revn]
    org.netbeans.core.network [1.11 20180815-unknown-revn]
    org.netbeans.core.nativeaccess/1 [1.32 20180815-unknown-revn]
    org.netbeans.core.multitabs/1 [1.13.0.1 1 20180815-unknown-revn]
    org.netbeans.core.io.ui/1 [1.31 20180815-unknown-revn]
    com.sun.tools.visualvm.uisupport/0 [1.4 180926]
    com.sun.tools.visualvm.core/0 [1.6 180926]
    com.sun.tools.visualvm.host/0 [1.0 180926]
    com.sun.tools.visualvm.application/0 [1.11 180926]
    com.sun.tools.visualvm.tools/0 [1.4 180926]
    com.sun.tools.visualvm.coredump/0 [1.1 180926]
    com.sun.tools.visualvm.threaddump/0 [1.0 180926]
    com.sun.tools.visualvm.heapviewer/0 [1.0 180926]
    com.sun.tools.visualvm.heapdump/0 [1.3 180926]
    com.sun.tools.visualvm.profiling/0 [1.5 180926]
    com.sun.tools.visualvm.sampler [2.1 180926]
    com.sun.tools.visualvm.sa/0 [1.1 180926]
    com.sun.tools.visualvm.modules.startup [1.1 180926]
    com.sun.tools.visualvm.profiler/0 [1.6 180926]
    com.sun.tools.visualvm.profiler.startup [1.1 171212]
    com.sun.tools.visualvm.modules.killapp/1 [1.2 171212]
    com.sun.tools.visualvm.modules.extensions/0 [1.5 171212]
    com.sun.tools.visualvm.modules.appui [1.0 180926]
    com.sun.tools.visualvm.jvmstat/0 [1.0 180926]
    com.sun.tools.visualvm.jvm/0 [1.1 180926]
    com.sun.tools.visualvm.jmx/0 [1.4 180926]
    com.sun.tools.visualvm.charts/0 [1.5 180926]
    com.sun.tools.visualvm.host.views/0 [1.0 180926]
    com.sun.tools.visualvm.host.remote/0 [1.0 180926]
    com.sun.tools.visualvm.attach/0 [1.1 180926]
    com.sun.tools.visualvm.application.views/0 [1.0 180926]
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy resolver: Mac
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy reloading failed! Trying fallback resolver.
INFO [org.netbeans.core.network.proxy.fallback.FallbackNetworkProxy]: Fallback system proxy resolver: no http_proxy variable found
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy reloading succeeded. Fallback provider was successful.
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy - mode: direct
INFO [org.netbeans.core.network.proxy.NetworkProxyReloader]: System network proxy: fell to default (correct if direct mode went before)
INFO [org.netbeans.ui.metrics.laf]: USG_LOOK_AND_FEEL
Diagnostic information
Input arguments:
    -Djdk.home=/Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home
    -Dnetbeans.default_userdir_root=/Users/grall-a/Library/Application Support/VisualVM
    -Dnetbeans.dirs=/Applications/VisualVM.app/Contents/Resources/visualvm/visualvm:/Applications/VisualVM.app/Contents/Resources/visualvm/profiler:
    -Dnetbeans.home=/Applications/VisualVM.app/Contents/Resources/visualvm/platform
    -Xms24m
    -Xmx256m
    -Dnetbeans.accept_license_class=com.sun.tools.visualvm.modules.startup.AcceptLicense
    -Dsun.jvmstat.perdata.syncWaitMs=10000
    -Dsun.java2d.noddraw=true
    -Dsun.java2d.d3d=false
    -Dorg.netbeans.core.TimeableEventQueue.quantum=360000
    --add-exports=java.desktop/sun.awt=ALL-UNNAMED
    --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor.event=ALL-UNNAMED
    --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED
    --add-exports=java.desktop/sun.swing=ALL-UNNAMED
    --add-exports=jdk.attach/sun.tools.attach=ALL-UNNAMED
    --add-opens=java.base/java.net=ALL-UNNAMED
    --add-opens=java.base/java.lang.ref=ALL-UNNAMED
    --add-opens=java.base/java.lang=ALL-UNNAMED
    --add-opens=java.desktop/javax.swing=ALL-UNNAMED
    --add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED
    -XX:+IgnoreUnrecognizedVMOptions
    -XX:+HeapDumpOnOutOfMemoryError
    -XX:HeapDumpPath=/Users/grall-a/Library/Application Support/VisualVM/1.4/var/log/heapdump.hprof
Compiler: HotSpot 64-Bit Tiered Compilers
Heap memory usage: initial 24,0MB maximum 256,0MB
Non heap memory usage: initial 7,3MB maximum -1b
Garbage collector: G1 Young Generation (Collections=13 Total time spent=0s)
Garbage collector: G1 Old Generation (Collections=0 Total time spent=0s)
Classes: loaded=6242 total loaded=6242 unloaded 0
INFO [org.netbeans.core.ui.warmup.DiagnosticTask]: Total memory 8 589 934 592
INFO [null]: Total physical memory 8 589 934 592
*** Profiler warning (Mon Feb 25 17:01:14 CET 2019): class com/google/api/client/http/javanet/ConnectionFactory, ldr = 1 not found anywhere
*** Profiler warning (Mon Feb 25 17:01:15 CET 2019): class com/google/api/client/http/HttpUnsuccessfulResponseHandler, ldr = 1 not found anywhere
INFO [org.netbeans.modules.profiler.ResultsManager]: /var/folders/_z/fjkkv6dd6gz_8jzjbtwrtj2w0000gp/T/visualvm_grall-a.dat/localhost_49265/snapshot-1551110526595.nps
java.nio.file.NoSuchFileException: /var/folders/_z/fjkkv6dd6gz_8jzjbtwrtj2w0000gp/T/visualvm_grall-a.dat/localhost_49265/snapshot-1551110526595.nps
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
    at java.base/sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:548)
    at java.base/sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:254)
    at java.base/java.nio.file.Files.copy(Files.java:1294)
[catch] at org.netbeans.modules.profiler.ResultsManager.exportSnapshot(ResultsManager.java:979)
    at org.netbeans.modules.profiler.ResultsManager.access$300(ResultsManager.java:140)
    at org.netbeans.modules.profiler.ResultsManager$7$1.doExport(ResultsManager.java:967)
    at org.netbeans.lib.profiler.ui.swing.ExportUtils$AbstractNPSExportProvider.export(ExportUtils.java:193)
    at org.netbeans.lib.profiler.ui.swing.ExportUtils$2.run(ExportUtils.java:314)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
INFO [null]: Last record repeated again.

Screenshots capture d ecran 2019-02-25 a 17 06 29

Desktop:

Additional context Application run several threads, use the package org.apache.jena and has a client that execute http requests using the package com.google.http-client. But this may not be relevant to the problem.

dmly commented 5 years ago

I got this issue as well.

leejh903 commented 5 years ago

I got this problem too! The environment that different from above is that I am using intellij and intellij plugin which connect with visualVM.

thurka commented 4 months ago

I just tested this issue using steps above and I cannot reproduce it with VisualVM 2.1.8.