When computeAllFrames, there is a method in ClassWriter getCommonSuperClass, that will return the common super type of given types. Here, use current classloader to load the given type. It should be Global.getClassLoader
java.lang.TypeNotPresentException: Type XXXXX not present
at wshade.org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1052)
at wshade.org.objectweb.asm.SymbolTable.addMergedType(SymbolTable.java:1264)
at wshade.org.objectweb.asm.Frame.merge(Frame.java:1311)
at wshade.org.objectweb.asm.Frame.merge(Frame.java:1255)
at wshade.org.objectweb.asm.MethodWriter.computeAllFrames(MethodWriter.java:1612)
at wshade.org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1548)
at wshade.org.objectweb.asm.MethodVisitor.visitMaxs(MethodVisitor.java:786)
at wshade.org.objectweb.asm.commons.LocalVariablesSorter.visitMaxs(LocalVariablesSorter.java:147)
at w.core.model.WatchTransformer$1$1.visitMaxs(WatchTransformer.java:114)
at wshade.org.objectweb.asm.ClassReader.readCode(ClassReader.java:2664)
at wshade.org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1512)
at wshade.org.objectweb.asm.ClassReader.accept(ClassReader.java:745)
at wshade.org.objectweb.asm.ClassReader.accept(ClassReader.java:425)
at w.core.model.WatchTransformer.transform(WatchTransformer.java:52)
at w.core.model.BaseClassTransformer.transform(BaseClassTransformer.java:48)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
at w.Global.addActiveTransformer(Global.java:256)
at w.core.Swapper.swap(Swapper.java:68)
at w.web.Websocketd$1.dispatch(Websocketd.java:98)
at w.web.Websocketd$1.onMessage(Websocketd.java:51)
at fi.iki.elonen.NanoWSD$WebSocket.handleWebsocketFrame(NanoWSD.java:229)
at fi.iki.elonen.NanoWSD$WebSocket.readWebsocket(NanoWSD.java:247)
at fi.iki.elonen.NanoWSD$WebSocket.access$200(NanoWSD.java:65)
at fi.iki.elonen.NanoWSD$WebSocket$1.send(NanoWSD.java:88)
at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:852)
at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:189)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.ClassNotFoundException: XXXXX
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at wshade.org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1050)
... 29 more
When computeAllFrames, there is a method in ClassWriter
getCommonSuperClass
, that will return the common super type of given types. Here, use current classloader to load the given type. It should beGlobal.getClassLoader