Redefinition failed with error 62 while trying to profile an application
Asked Answered
P

6

63

If I try to profile application, (which is prepared under Eclipse, but running from command line) with the help of VisualVM, I get the following error message

enter image description here

Simultaneously, the project folder is fouled with newly created class files. Although they are already existing in target/classes.

The project structure is Maven's, i.e. there is a foder target/classes in current directory and I us the following command to run the application

java -Xmx16g -cp target/classes tests.Runner01

How to fix?

UPDATE

The same occurs with conventional java project too.

Below it the picture of populated class files, which located where they should not

enter image description here

Pownall answered 9/11, 2014 at 23:41 Comment(0)
A
89

Here https://netbeans.org/bugzilla/show_bug.cgi?id=191297 appears a workaround: run profiled application with -Xverify:none

Authorize answered 10/11, 2014 at 19:14 Comment(12)
The correct bug is this one: netbeans.org/bugzilla/show_bug.cgi?id=245522 and bugs.openjdk.java.net/browse/JDK-8050485. The problem is already fixed in JDK 7u71 and JDK 8u31.Dorty
I ran into this problem with java version "1.8.0_121"Congregation
@Congregation You solved this problem? I am also getting same.Vanettavang
Problem still exists in 1.8.0_131Stipulate
and with 1.8.0_144Heliogabalus
and in 1.8.0_152Enviable
still in 1.8.0_162, to put a bit saltMoluccas
I also encountered this bug, but upgrading to the latest version fixed the issue.Phonetics
When I added -Xverify:none, the profiling tab didn't appear the next time I launched.Bureau
The bug is still present in 1.8.0_181. It disappeared with the suggested solution: -Xverify:noneVictimize
Also had to use this workarround on JDK 11 in intellijBoggers
Same problem with 1.8.0_301Purkey
B
9

If you are using eclipse, then go to Run/Debug configuration. Select your application from left side and click on Arguments.

Here you will see two text boxes.

1. Program Arguments
2. VM Arguments

In VM arguments, enter below commands. -Xverify:none

Click on apply and then Run/Debug.

Britzka answered 25/6, 2019 at 14:43 Comment(0)
S
7

According to this GitHub issue, it's been fixed. Updating to version 1.4 solved the problem for me.

Survival answered 7/2, 2018 at 23:43 Comment(1)
Thanks for pointing this out. Ran into this problem today and updated VisualVM. It works now.Bounded
E
6

For IntelliJ, you can set -Xverify:none as follows:

Run > Edit Configurations... > Modify options (Alt + M) > Add VM options.

This should reveal a new field VM options, to which you can write -Xverify:none.

Erechtheum answered 14/4, 2022 at 11:19 Comment(0)
F
1

The workaround I found using IntelliJ is to compile to Java 1.6 byte code. The menu option to do so is: File - Project Structure, then set Project language level to 6.

This precludes you from using Java features only available with Java 7 or 8.

Floury answered 6/11, 2017 at 20:13 Comment(0)
F
1

Just letting others know, adding the VM option -Xverify:none is the recommended way as per the official Troubleshooting Guide.

Fourcycle answered 15/3, 2023 at 12:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.