bytecode - ClassNotFound error during class verification with ASM's Class Verifier (org.objectweb.asm.util.CheckClassAdapter) -


So here's the snippet of bytecode that I am trying to use as the Class Verifier of ASM: < Pre> public & lt; Init & gt; (Ljava / IO / InputStream;) V upload 1 upload 1 SIPUSH 2048 new organization / Apache / xerces / impl / msg / XMLMessageFormatter DUP INVOKESPECIAL ORG / Apache / xerces / impl / msg / XMLMessageFormatter. & Lt; Init & gt; () V Invokastatic Java / Ut / Locale.Get Default () Lijava / Ut / Locale; INVOKESPECIAL ORG / apache / xerces / impl / io / UTF8 reader. & Lt; Init & gt; (Lajava / io / InputStream; ILorg / apache / xerces / util / messageFormatter; Ljava / util / Locale;) V Return Maximum = 5 MAXLOCALS = 2

This is part of a larger class Org / apache / xerces / impl / when / UTF8Reader. Now, when I run the bytecode of this class through the class validator provided by the ASM, I get the following result:

  org.objectweb.asm.tree.analysis.AnalyzerException ** error java.lang.ClassNotFoundException: org.apache.xerces.util.MessageFormatter ** instruction on org.objectweb.asm.tree.analysis.Analyzer.analyze (unknown source) at org.objectweb.asm.util.CheckClassAdapter At 7 Verify the org.objectweb.asm.util.CheckClassAdapter.verify on OrgkobjectwebkasmkutilkCheckClassAdapterkmain (Unknown Source) (due to unknown source) (Unknown Source): java.lang.RuntimeException: java. Lang ClassNotFoundException: org.apache.xerces.util.MessageFormatter on org.objectweb.asm.tree.analysis.SimpleVerifier.getClass (Unknown Source) at org.objectweb.asm.tree.analysis.SimpleVerifier.isAssignableFrom (Unknown Source) at the organization. objectweb.asm.tree.analysis.SimpleVerifier.isSubTypeOf (Unknown Source org.objectweb.asm.tree.analysis.BasicVerifier.naryOperation (Unknown Source) at Org.objectweb) org.objectweb.asm.tree.analysis.Frame.execute (Unknown source) ... 4 is more at asm.tree.analysis.BasicVerifier.naryOperation (unknown source); Init & gt; (Ljava / IO / InputStream;) V 00000 UTF8Reader InputStream: aload 0 00001 UTF8Reader InputStream: UTF8Reader: aload 1 00002 UTF8Reader InputStream: UTF8Reader InputStream: SIPUSH 2048 00003 UTF8Reader InputStream: UTF8Reader InputStream I: New org / Apache / xerces / impl / message / XMLMessageFormatter 00004 UTF8Reader InputStream: UTF8Reader InputStream I XMLMessageFormatter: DUP 00005 UTF8Reader InputStream: UTF8Reader InputStream I XMLMessageFormatter XMLMessageFormatter :. INVOKESPECIAL org / Apache / xerces / impl / message / XMLMessageFormatter & lt; Init & gt; () V00006 UTF 8 Reader inputstream: UTF 8 Reader inputstream I XMLMessageFormatter: INVOKESTATIC Java / Ut / LocaleGet Default () Ljava / util / Locale; 00007 UTF8Reader InputStream: UTF8Reader InputStream I XMLMessageFormatter Location:. INVOKESPECIAL org / Apache / xerces / impl / When / UTF8Reader & LT; Init & gt; (Ljava / io / InputStream; ILorg / apache / xerces / util / MessageFormatter; Ljava / util / Locale;) V00008? : Return   

I am quite confused with this last bit ... Why is the Class Notaffond exception being given to this organization / Apache / xerces / util / messageFormatter object line 7?

Thank you.

ASM's verifier tool checks the validity of each stack and variable slot, one of the JVM specification checks It is that the value of all the variables and stack slots are the same type on the merge point. Therefore, this implementation loads classes to find normal super types.

Comments