AdoptOpenJDK / jitwatch

Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.
Other
3.08k stars 437 forks source link

After the SpringBoot project adds source and class to the config, the following error occurs when you click start #364

Closed CodeHourra closed 1 year ago

CodeHourra commented 2 years ago

After the SpringBoot project adds source and class to the config, the following error occurs when you click start

hello~, I want to use JitWatch to help me analyze which code in my SpringBoot project is too high because which code is compiled and analyzed by JIT, but after pouring into the source code and class directory of the project according to wiki, there is an exception shown below. I don't know how to solve it for the time being, or whether there is a problem with my way of use. Please give me some advice. Thank you very much.

jitwatch.out

19:01:21.127 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.StringUtils'
19:01:21.128 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.StringUtils'
19:01:21.129 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.StringUtils'
19:01:21.129 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.StringUtils'
19:01:21.148 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.ConcurrentReferenceHashMap$Segment'
19:01:21.148 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.ConcurrentReferenceHashMap$Segment'
19:01:21.152 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.Assert'
19:01:21.152 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.Assert'
19:01:21.153 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.ConcurrentReferenceHashMap$Segment'
19:01:21.153 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.core.ResolvableType'
19:01:21.153 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.ConcurrentReferenceHashMap$Segment'
19:01:21.154 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.core.ResolvableType'
19:01:21.160 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.ConcurrentReferenceHashMap'
19:01:21.161 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.ConcurrentReferenceHashMap'
19:01:21.161 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.core.ResolvableType'
19:01:21.161 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.util.ObjectUtils'
19:01:21.161 [Thread-4] ERROR o.a.j.u.ParseUtil - ClassNotFoundException: 'org.springframework.core.ResolvableType'
......

jitwatch.out.log

jitlog jitwatch01 jitwatch2
chriswhocodes commented 2 years ago

Hi, sorry for the late response, I didn't see the notification for this issue.

Are you sure that the missing classes are found in spring-boot-client/build/classes/java and not in a library jar file?

To get the most from JITWatch you should try to include both your own class files and the 3rd party jars used by your application.

morenice commented 2 years ago

@chriswhocodes @CodeHourra Hi, I also faced the same problem. My projects is based on spring boot using gradle. I tried a things, but I saw only the ClassNotFoundException error message. jitwatch seems that jar files are not found. Can you give me a brief example using spring boot gradle for jit watch? (config > class locations)

chriswhocodes commented 2 years ago

Are you sure the missing classes are from spring-boot-client? The first poster mentioned org.springframework.* classes which sound like they are from a library jar that has not been mounted.

Please can you confirm the .class file is actually found in the class folder you have mounted?

Thanks,

Chris

morenice commented 2 years ago

@chriswhocodes Thanks for your answer. spring-boot-client(aka myproject) not missing at jitwatch.

I set the class folder that the jar file directory downloaded by gradle. The 3rd jars downloaded with gradle are currently in the directory below. ~/.gradle/caches/modules-2/files-2.1

the 3rd party is only jar files, not .classes. I think I asked the wrong question.
How can jitwatch recognize 3rd party jars?

For reference, I set ~/.gradle/caches/modules-2/files-2.1 class folder, I saw 'MetaMemerber not found' error message.

image
chriswhocodes commented 2 years ago

Hi @morenice JITWatch config lets you add

If you are adding jars then you need to add the jar itself using Add File(s) and not the folder containing the jars.

Kind regards,

Chris