Pedro Barros
Pedro Barros

Reputation: 1336

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?

Upvotes: 1

Views: 98

Answers (2)

DontFeedTheHypeMachine
DontFeedTheHypeMachine

Reputation: 310

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.

Upvotes: 1

V G
V G

Reputation: 19002

The problem is that what you deploy does not contain the BaseController.class file. In order to test it: unpack (i.e unzip) the deployed war, jar or ear file and check if the file BaseController.class is in the right place there. Most probably the file is no there.

Upvotes: 0

Related Questions