Search code examples
javajax-rsnoclassdeffounderrorresteasybuildpath

NoClassDefFoundError when using resteasy @Path annotation


I have a Controller class annotated with @Path annotation from resteasy. It runs normally.

But when I extend this class from a BaseController, that is located in another project (included in this project build path), I get an error of NoClassDefFoundError when trying to reference to BaseController.

WORKS:

@Path("/")
public class Controller {...}

WORKS:

@Path("/")
public class Controller extends BaseController {...} //BaseControler from the same project

WORKS:

public class Controller extends BaseController {...} //BaseControler from other project

DOESN´T WORK: (NoClassDefFoundError)

@Path("/")
public class Controller extends BaseController {...} //BaseControler from other project

Any idea on this?


Solution

  • Your problem could be the same from this question: Java project unable to refer to another project In that case, the "OtherProjectClass" could not be instatied.