I have a grizzly http server that runs fine on Windows but fails to start on Ubuntu, throwing the following exception:
Exception in thread "main" java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:331)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:311)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.<init>(GrizzlyHttpContainer.java:337)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory.createHttpServer(GrizzlyHttpServerFactory.java:119)
at server.ServerCreator.startServer(ServerCreator.java:35)
at server.ServerCreator.main(ServerCreator.java:41)
On Windows the server starts fine:
Feb 04, 2016 5:57:42 PM org.glassfish.grizzly.http.server.NetworkListener start
INFO: Started listener bound to [localhost:10000]
Feb 04, 2016 5:57:42 PM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer] Started.
Any suggestions what could be a potential cause for the same code to throw the above exception on Linux specifically? This question suggests that the exception is caused by having both JAX-RS 1 and JAX-RS 2 jars on the classpath, but I have checked for that and if that was the case it should throw the same exception on Windows.