我正在使用 tomcat 5 和 JSON parser net/sf/json
。我在我的项目中导入json-lib2.4-jdk15.jar
并将其添加到我的 tomcat 中的“common/endorsed”目录中。但是当我启动我的 servlet 时,我遇到了这个异常:
java.lang.NoClassDefFoundError: net/sf/json/JSONException
net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:108)
net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:84)
com.britecs.atajer.bl.json.SubCategories.getSubCategory(SubCategories.java:37)
com.britecs.atajer.pl.json.SubCategoriesServlet.doGet(SubCategoriesServlet.java:23)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
有人能帮我吗?