我有一个 businessLogic 层,我想在 servlet 中使用它,但是我做的任何事情都会给我一个错误
@WebServlet("/Servlet")
public class Servlet extends HttpServlet {
private static final long serialVersionUID = 1L;
IPersonService service;
public Servlet() {
super();
// TODO Auto-generated constructor stub
}
@Override
public void init(){
service=new PersonService();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
service.getAll();
}
我已经尝试了一切.....ps。PersonService 来自外部项目,我有参考。我在他自己的项目中测试它并且它可以工作,但是当我想在 servlet 中使用它时它给了我一个奇怪的错误
Caused by: java.lang.NoClassDefFoundError: LBusinessInterfaces/IPersonService;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.lang.Class.getDeclaredFields(Unknown Source)
at org.apache.catalina.util.Introspection.getDeclaredFields
请有人帮忙