@JFinal 用到了FastJson.getJson().parse(),出现了这样的错误: com.jfinal.core.ActionHandler error 严重: /add java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.jfinal.aop.Invocation.invoke(Invocation.java:87) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
@JFinal Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.jfinal.aop.Invocation.invoke(Invocation.java:73) ... 25 more Caused by: java.lang.NoClassDefFoundError: com/alibaba/fastjson/JSON at com.jfinal.json.FastJson.parse(FastJson.java:42) at com.common.AddController.index(AddController.java:17) ... 30 more Caused by: java.lang.ClassNotFoundException: com.alibaba.fastjson.JSON at java.net.URLClassLoader.findClass(URLClassLoader.java:381) 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 org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:430) at com.jfinal.server.JFinalClassLoader.loadClass(JFinalClassLoader.java:53) ... 32 more
String jsonString = HttpKit.readData(getRequest());
User user = FastJson.getJson().parse(jsonString, User.class);