Java Json 解析器
我正在使用 tomcat 5 和 JSON 解析器 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)
有人可以帮助我吗?
I'm using tomcat 5 and JSON parser net/sf/json
. I import json-lib2.4-jdk15.jar
in my project and add it to `common/endorsed' dir in my tomcat. But when I start my servlet I have this exception:
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)
Can someone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定 'tomcat/common/endorsed' 是正确的目录使用。您是否尝试过在
tomcat/lib
中安装 JAR 文件?I'm not sure 'tomcat/common/endorsed' is the right directory to be using. Have you tried installing your JAR file in
tomcat/lib
?