1

I am using netbeans to create my project and my code runs fine on Localhost . I create a war file and deploy on tomcat 7 and 8 , and it throws Internal server Error 500 . A little changes in code after a day of problem solving got us here to a point where our rest api where we use Mediatype.Application_json , it crashes gives the Internal server error .

When a string is passed using Mediatype.TEXT_HTML , we dont have an issue .

Unfortunately POST for rest api only taken in JSON and I am desperately trying to find someone who can solve this

Please help

bezzerk
  • 11
  • 1
  • can you please post the error stack trace? – Praveen Kumar K S Mar 03 '16 at 15:11
  • exception javax.servlet.ServletException: Servlet.init() for servlet com.sprintler.services.ApplicationConfig threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:676) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521) – bezzerk Mar 03 '16 at 15:23
  • root cause java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map; org.glassfish.jersey.server.ApplicationHandler.(ApplicationHandler.java:304) org.glassfish.jersey.server.ApplicationHandler.(ApplicationHandler.java:285) org.glassfish.jersey.servlet.WebComponent.(WebComponent.java:311) – bezzerk Mar 03 '16 at 15:24
  • Unable to add more data in One post due to character restrictions but this is the top few lines of EXCEPTION and ROOT CAUSE – bezzerk Mar 03 '16 at 15:27
  • ^ @bezzerk: please transfer the code in comments into your question. There are formatting tools that will make it much more readable. – halfer Mar 09 '16 at 23:26

2 Answers2

0

You probably have two versions of the JAX-RS jars on the classpath. Or you have an unwanted jsr311-api jar on your classpath. See this response.

Community
  • 1
  • 1
Bax
  • 4,260
  • 5
  • 43
  • 65
0

I made sure all the versions etc of all JAX jars were not duplicated . And since I was on a deadline , I just used Maven in my project and works like a charm

bezzerk
  • 11
  • 1