我试图在Windows 7 64位上使用jvisualvm配置一个简单的java应用程序。我正在使用Java 8和JDK 1.8.0_131。我能够看到我的应用程序并使用VisualVM的Sample选项卡,但是当我使用Profile选项卡的CPU选项时,我得到一个" Redefinition失败,错误62"。此错误在线记录,常见的解决方案是在启动应用程序时包含标志-Xverify:none。但是,使用此标志对我没有影响。我已经尝试了JVisualVM本身和我的简单程序jar都没有区别。以下是我正在使用的终端命令。
将Xverify与简单程序一起使用。
java -jar SimpleProfile.jar -Xverify:none
将Xverify与jvisualvm一起使用
./jvisualvm.exe -J-Xverify:none
两者都是从Git Bash终端运行而没有效果。我也在CMD中尝试过类似的命令。
我的PC上没有管理员权限,我注意到我无法使用Windows资源监视器。这可能与问题有关,还是我的论点有问题?
额外信息: 当探查器失败时,我在终端
中收到以下错误Profiler Agent: Waiting for connection on port 5140 (Protocol
version: 15)
Profiler Agent: Established connection with the tool
Profiler Agent: Local accelerated session
Profiler Agent Error: Redefinition failed for classes:
sun.nio.fs.NativeBuffer$Deallocator
sun.rmi.transport.DGCImpl$1
sun.rmi.transport.tcp.TCPTransport$AcceptLoop
sun.rmi.transport.DGCAckHandler$1
com.profiletest.Main
sun.nio.ch.FileChannelImpl$Unmapper
java.io.DeleteOnExitHook$1
java.util.ResourceBundle$RBClassLoader
java.util.concurrent.ThreadPoolExecutor$Worker
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask
java.lang.ref.Reference$ReferenceHandler
java.lang.ClassLoader
java.util.logging.LogManager$Cleaner
com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout
java.lang.ApplicationShutdownHooks$1
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler
java.util.concurrent.FutureTask
java.lang.ref.Finalizer$FinalizerThread
java.lang.reflect.Method
Profiler Agent Error: with message: Redefinition failed with
error 62
Check JVMTI documentation for this error code.
Debug: writing class file: sun.nio.fs.NativeBuffer
$Deallocator, into file: sun.nio.fs.NativeBuffer
$Deallocator.class
Debug: writing class file: sun.rmi.transport.DGCImpl$1, into
file: sun.rmi.transport.DGCImpl$1.class
Debug: writing class file:
sun.rmi.transport.tcp.TCPTransport$AcceptLoop, into file:
sun.rmi.transport.tcp.TCPTransport$AcceptLoop.class
Debug: writing class file: sun.rmi.transport.DGCAckHandler$1,
into file: sun.rmi.transport.DGCAckHandler$1.class
Debug: writing class file: com.profiletest.Main, into file:
com.profiletest.Main.class
Debug: writing class file: sun.nio.ch.FileChannelImpl
$Unmapper, into file: sun.nio.ch.FileChannelImpl
$Unmapper.class
Debug: writing class file: java.io.DeleteOnExitHook$1, into
file: java.io.DeleteOnExitHook$1.class
Debug: writing class file: java.util.ResourceBundle
$RBClassLoader, into file: java.util.ResourceBundle
$RBClassLoader.class
Debug: writing class file:
java.util.concurrent.ThreadPoolExecutor$Worker, into file:
java.util.concurrent.ThreadPoolExecutor$Worker.class
Debug: writing class file:
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask, into file:
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask.class
Debug: writing class file: java.lang.ref.Reference
$ReferenceHandler, into file: java.lang.ref.Reference
$ReferenceHandler.class
Debug: writing class file: java.lang.ClassLoader, into file:
java.lang.ClassLoader.class
Debug: writing class file: java.util.logging.LogManager
$Cleaner, into file: java.util.logging.LogManager
$Cleaner.class
Debug: writing class file:
com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout,
into file:
com.sun.jmx.remote.internal.ServerCommunicatorAdmin
$Timeout.class
Debug: writing class file:
java.lang.ApplicationShutdownHooks$1, into file:
java.lang.ApplicationShutdownHooks$1.class
Debug: writing class file:
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler, into
file: sun.rmi.transport.tcp.TCPTransport
$ConnectionHandler.class
Debug: writing class file: java.util.concurrent.FutureTask,
into file: java.util.concurrent.FutureTask.class
Debug: writing class file: java.lang.ref.Finalizer
$FinalizerThread, into file: java.lang.ref.Finalizer
$FinalizerThread.class
Debug: writing class file: java.lang.reflect.Method, into
file: java.lang.reflect.Method.class
答案 0 :(得分:5)
java -Xverify:none -jar SimpleProfile.jar有效。我想我没有用尽所有的选择。