You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
你好:
在1.2.71版本下,使用如下方法测试可以复现。JDK版本1.7.
public class DbInfoTest {
public static void main(String[] args) throws Exception {
String json = "{"test":"test"}";
Test t = JSON.parseObject(json,Test.class);
System.out.println(t.test);
}
}
public class Test {
public String test;
}
报错信息:
Exception in thread "main" java.lang.NoClassDefFoundError: java/time/LocalDateTime
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2595)
at java.lang.Class.getConstructor0(Class.java:2895)
at java.lang.Class.getConstructor(Class.java:1731)
at com.alibaba.fastjson.parser.deserializer.ASMDeserializerFactory.createJavaBeanDeserializer(ASMDeserializerFactory.java:90)
at com.alibaba.fastjson.parser.ParserConfig.createJavaBeanDeserializer(ParserConfig.java:1075)
at com.alibaba.fastjson.parser.ParserConfig.getDeserializer(ParserConfig.java:882)
at com.alibaba.fastjson.parser.ParserConfig.getDeserializer(ParserConfig.java:592)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:679)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:396)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:300)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:573)
at com.rkhd.ienterprise.dbinfo.DbInfoTest.main(DbInfoTest.java:11)
Caused by: java.lang.ClassNotFoundException: java.time.LocalDateTime
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 13 more
The text was updated successfully, but these errors were encountered:
eksgem
changed the title
1.2.71版本在JSON.parseObject时,报错java.lang.ClassNotFoundException: java.time.LocalDateTime
1.2.71版本,在JDK1.7下运行JSON.parseObject时,报错java.lang.ClassNotFoundException: java.time.LocalDateTime
Jun 18, 2020
你好:
在1.2.71版本下,使用如下方法测试可以复现。JDK版本1.7.
public class DbInfoTest {
public static void main(String[] args) throws Exception {
String json = "{"test":"test"}";
Test t = JSON.parseObject(json,Test.class);
System.out.println(t.test);
}
}
public class Test {
public String test;
}
报错信息:
Exception in thread "main" java.lang.NoClassDefFoundError: java/time/LocalDateTime
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2595)
at java.lang.Class.getConstructor0(Class.java:2895)
at java.lang.Class.getConstructor(Class.java:1731)
at com.alibaba.fastjson.parser.deserializer.ASMDeserializerFactory.createJavaBeanDeserializer(ASMDeserializerFactory.java:90)
at com.alibaba.fastjson.parser.ParserConfig.createJavaBeanDeserializer(ParserConfig.java:1075)
at com.alibaba.fastjson.parser.ParserConfig.getDeserializer(ParserConfig.java:882)
at com.alibaba.fastjson.parser.ParserConfig.getDeserializer(ParserConfig.java:592)
at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:679)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:396)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:300)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:573)
at com.rkhd.ienterprise.dbinfo.DbInfoTest.main(DbInfoTest.java:11)
Caused by: java.lang.ClassNotFoundException: java.time.LocalDateTime
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 13 more
The text was updated successfully, but these errors were encountered: