Open ov7a opened 6 years ago
Can you provide a minimal program that reproduces the issue (ideally one file with a main
)? This will spare a lot of troubleshooting time. TIA
I have the exact same error when creating an injector with Guice. If I put the line:
val injector = Guice.createInjector(MainModule())
in comments, the error is gone.
Here is my stacktrace
[quasar] WARNING: UnableToInstrumentException encountered when instrumenting kotlin/SynchronizedLazyImpl#getValue()Ljava/lang/Object;: Unable to instrument kotlin/SynchronizedLazyImpl#getValue()Ljava/lang/Object; because of synchronization
[quasar] ERROR: Unable to instrument class kotlin/SynchronizedLazyImpl
java.lang.NullPointerException
at co.paralleluniverse.asm.MethodWriter.visitMaxs(Unknown Source)
at co.paralleluniverse.asm.tree.MethodNode.accept(Unknown Source)
at co.paralleluniverse.fibers.instrument.InstrumentClass.visitEnd(InstrumentClass.java:260)
at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
at co.paralleluniverse.fibers.instrument.QuasarInstrumentor.instrumentClass(QuasarInstrumentor.java:134)
at co.paralleluniverse.fibers.instrument.QuasarInstrumentor.instrumentClass(QuasarInstrumentor.java:94)
at co.paralleluniverse.fibers.instrument.JavaAgent$Transformer.transform(JavaAgent.java:209)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at kotlin.LazyKt.lazy(Lazy.kt:40)
at com.authzee.kotlinguice4.KotlinModule.<init>(KotlinModule.kt:57)
at com.stingray.newsfeedservice.modules.MainModule.<init>(MainModule.kt:9)
at com.stingray.newsfeedservice.HelloWorldKt.main(HelloWorld.kt:14)
[quasar] ERROR: while transforming kotlin/SynchronizedLazyImpl: null
java.lang.NullPointerException
at co.paralleluniverse.asm.MethodWriter.visitMaxs(Unknown Source)
at co.paralleluniverse.asm.tree.MethodNode.accept(Unknown Source)
at co.paralleluniverse.fibers.instrument.InstrumentClass.visitEnd(InstrumentClass.java:260)
at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
at co.paralleluniverse.fibers.instrument.QuasarInstrumentor.instrumentClass(QuasarInstrumentor.java:134)
at co.paralleluniverse.fibers.instrument.QuasarInstrumentor.instrumentClass(QuasarInstrumentor.java:94)
at co.paralleluniverse.fibers.instrument.JavaAgent$Transformer.transform(JavaAgent.java:209)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at kotlin.LazyKt.lazy(Lazy.kt:40)
at com.authzee.kotlinguice4.KotlinModule.<init>(KotlinModule.kt:57)
at com.stingray.newsfeedservice.modules.MainModule.<init>(MainModule.kt:9)
at com.stingray.newsfeedservice.HelloWorldKt.main(HelloWorld.kt:14)
fun main(){ println("quasar...")
Fiber<Int>(){
fun run():Int{
var i = 0
while(true){
println("${i++}")
sleep(1000)
}
}
}.start()
val line = readLine() //I have same error when execute this line
}
Problem occurs when jackson's mapper.readValue is called, but is does not related to jackson itself, but to lazy value in kotlin code.
Quasar version: 0.7.9 Kotlin version: 1.1.4 Jackson version: 2.8.6
Stacktrace: