这几天把eclipse中的maven web项目都改成了用jetty启动的方式,感觉jetty比较方便配置,直接在help中下载插件就可以。
但是也遇到了一些问题,其中一个问题研究了好半天才弄懂,是我自己绕远了。
当我们的dom文件中配置了JSON之后,服务启动不起来,每次启动都报错,如下:
2017-04-25 13:56:30.738:WARN:oejuc.AbstractLifeCycle:FAILED spring: java.lang.NoClassDefFoundError: net/sf/json/JSONObject
java.lang.NoClassDefFoundError: net/sf/json/JSONObject
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:612)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:243)