我在学校用 eclipse 用我的拇指驱动器工作,然后把拇指驱动器带回家了。
下次运行程序时突然出现这个错误:
Exception in thread "main" java.lang.IllegalArgumentException: Unable to create serializer "com.esotericsoftware.kryo.serializers.FieldSerializer" for class: com.esotericsoftware.kryonet.FrameworkMessage$RegisterTCP
at com.esotericsoftware.kryo.Kryo.newSerializer(Kryo.java:338)
at com.esotericsoftware.kryo.Kryo.newDefaultSerializer(Kryo.java:317)
at com.esotericsoftware.kryo.Kryo.getDefaultSerializer(Kryo.java:310)
at com.esotericsoftware.kryo.Kryo.register(Kryo.java:354)
at com.esotericsoftware.kryonet.KryoSerialization.<init>(KryoSerialization.java:33)
at com.esotericsoftware.kryonet.KryoSerialization.<init>(KryoSerialization.java:25)
at com.esotericsoftware.kryonet.Client.<init>(Client.java:73)
at com.esotericsoftware.kryonet.Client.<init>(Client.java:55)
at test.TestClient.<init>(TestClient.java:32)
at test.TestClient.main(TestClient.java:39)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at com.esotericsoftware.kryo.Kryo.newSerializer(Kryo.java:325)
... 9 more
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.objectweb.asm.MethodVisitor, but class was expected
at com.esotericsoftware.reflectasm.FieldAccess.insertConstructor(FieldAccess.java:144)
at com.esotericsoftware.reflectasm.FieldAccess.get(FieldAccess.java:109)
at com.esotericsoftware.kryo.serializers.FieldSerializer.rebuildCachedFields(FieldSerializer.java:104)
at com.esotericsoftware.kryo.serializers.FieldSerializer.<init>(FieldSerializer.java:50)
... 14 more
我从未见过这种错误,我不知道如何解决它。每次我使用 kryonet 库时都会发生这种情况。有什么可用的解决方案吗?