質問

When using VisualVM for cpu-profiling of my application, I run into the error

"Profiler Agent Error: with message: Redefinition failed with error 66".

Upon that, it copies all the class-files from the build path to the location I've started the application from.

I tried to find some information on it, the error code means (According to JVMTI-documentation):

JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED (66)
A direct superclass is different for the new class version, or the set of directly implemented interfaces is different.

As profiling usually works in my environment (Java build 1.7.0_09-b05, Fedora 17 64-bit). I've tried "-Xshare:off" as said in the Visualvm-docs, without any effect.

As this is the only Java-SE application I'm experiencing this problem with, it seems that it is somehow related to the libraries I'm using. The following are in my classpath:

  • Log4j 1.2.17
  • Apache OpenJPA 2.2.1
  • Commons Configuration 1.9
  • Commons Pool 1.6
  • Postgresql 9.1-901jdbc4
  • imgscalr-lib-4.2

Can anyone see a correlation between the libraries and the error? I really don't have an idea anymore.

役に立ちましたか?

解決

It looks like this can be caused by JPA. You can use Sampler instead of Profiler. Another possibility is to define root methods and instrumentation filter so that classes instrumented by JPA are not profiled by VisualVM. See Profiling With VisualVM, Part 1 and Profiling With VisualVM, Part 2 to get more information about profiling and how to set profiling roots and instrumentation filter.

他のヒント

A small addition: I had the same error message when profiling an application that uses OpenJPA. The errors seem to go away after simply clicking "OK" in each error dialog as long as you don't shut down the application.

So you can simply press the button to reset the collected results and run the code again. E.g. by running it in a loop and using new Scanner(System.in).nextLine() or through a button click in a UI.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top