Special exceptions for Jetty + Json-lib library

Today the project was started with Jetty, it started normally under Tomcat, and it was started in the Jetty container, and a ClassNotFoundException was reported inexplicably : net.sf.json.JSONObject The details are as follows:

When the Jetty container is combined with Maven, the json-lib related class libraries are not loaded when jetty is released, so when the project starts, if the json-lib package is used, ClassNotFound will also appear.< /p>

Solution:

Right-click the project Run As / Debug As ——> Enter the Configurations interface, select the Jetty container, and then configure the Dependencies of the project, Check the json-lib package and restart jetty, as follows

ClassNotFoundException: net.sf.json.JSONObject is as follows:

< p>

Leave a Comment

Your email address will not be published.