How do I use a dependency for Servlet?

I have a businessLogic layer and I want to use it in servlet, but anything I do it throws me an error:

public class Servlet extends HttpServlet {
    private static final long serialVersionUID = 1L;
       IPersonService service;
    public Servlet() {
        // TODO Auto-generated constructor stub

    public void init(){
        service=new PersonService();
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

PersonService is from an external project and I have reference. I test it in its own project and it works, but when I want to use it in servlet it gives me a strange error:

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


  • You need to have your external dependency jar that contains your business interface (PersonService). into the servlet container. Should be either 'lib' folder of the container, or it should be found inside your projects 'WEB-INF/lib' folder.