我在我的项目中使用JSONObject和JSONArray,在添加json_simple-1.1.jar构建路径后eclipse运行正常,但是当我在IE中打开我的页面时,我得到如下错误,我也发现没有json_simple- 1.1.jar在WEB-INF / lib中,所以我可以直接将文件复制到那里,但我不确定为什么eclipse不会自动部署它?有没有办法部署jar文件自动?我用谷歌搜索但没有有用的答案。
java.lang.NoClassDefFoundError: org/json/simple/JSONArray
java.lang.Class.getDeclaredMethods0(Native Method)
java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
java.lang.Class.getDeclaredMethods(Class.java:1763)
java.beans.Introspector$1.run(Introspector.java:1259)
java.security.AccessController.doPrivileged(Native Method)
java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1257)
java.beans.Introspector.getTargetMethodInfo(Introspector.java:1125)
java.beans.Introspector.getBeanInfo(Introspector.java:383)
java.beans.Introspector.getBeanInfo(Introspector.java:155)
org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:896)
org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:926)
org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:801)
org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:937)
org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:493)
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:816)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
com.gehc.nozomi.common.filter.AccessFilter.doFilter(AccessFilter.java:53)
答案 0 :(得分:0)
我明白了!我使用的是eclipse 3.4,有J2EE Module Dependencies来配置Deployment Assembly。