protostuff icon indicating copy to clipboard operation
protostuff copied to clipboard

ClassLoader.loadClass(java.lang.String) on a null object reference

Open mikelhm opened this issue 4 years ago • 5 comments

 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String)' on a null object reference
    at io.protostuff.runtime.RuntimeEnv.loadClass(RuntimeEnv.java:297)
    at io.protostuff.runtime.DefaultIdStrategy.getSchemaWrapper(DefaultIdStrategy.java:185)
    at io.protostuff.runtime.DefaultIdStrategy.resolvePojoFrom(DefaultIdStrategy.java:524)
    at io.protostuff.runtime.ObjectSchema.readObjectFrom(ObjectSchema.java:682)
    at io.protostuff.runtime.ObjectSchema.mergeFrom(ObjectSchema.java:350)
    at io.protostuff.ByteArrayInput.mergeObject(ByteArrayInput.java:488)
    at io.protostuff.runtime.RuntimeRepeatedFieldFactory$5.mergeFrom(RuntimeRepeatedFieldFactory.java:268)
    at io.protostuff.runtime.RuntimeSchema.mergeFrom(RuntimeSchema.java:466)
    at io.protostuff.runtime.ObjectSchema.readObjectFrom(ObjectSchema.java:693)
    at io.protostuff.runtime.ObjectSchema.mergeFrom(ObjectSchema.java:350)
    at io.protostuff.ByteArrayInput.mergeObject(ByteArrayInput.java:488)
    at io.protostuff.runtime.RuntimeReflectionFieldFactory$15$1.mergeFrom(RuntimeReflectionFieldFactory.java:1399)

mikelhm avatar Oct 24 '19 03:10 mikelhm

version 1.5.2

mikelhm avatar Oct 24 '19 03:10 mikelhm

It looks like Thread.currentThread().getContextClassLoader() returned null based on your stacktrace.

dyu avatar Oct 24 '19 04:10 dyu

What jvm version are you using?

dyu avatar Oct 24 '19 04:10 dyu

It looks like Thread.currentThread().getContextClassLoader() returned null based on your stacktrace.

YES How to solve the problem, Do you have any idea? image

mikelhm avatar Oct 24 '19 04:10 mikelhm

Try a newer version of java 1.8 That release you have may have had a regression (bug)

dyu avatar Oct 24 '19 04:10 dyu