I have Jersey Rest service, which works fine from browser, but when I call it with angular http.get I got 405 "Method Not Allowed". Both server and client run in the same tomcat8
I've tried to add CORS headers "Access-Control-Allow-Origin", "Access-Control-Allow-Methods", no luck.
I added custom @WebFilter and found Additional filter Tomcat Websocket Filter in FilterChain which I suppose is responsible for this error. But I have no idea how to configure or get rid of it.
My web.xml is blank.
Service
@GET
@Path("/findalljson")
@Produces(MediaType.APPLICATION_JSON)
public String findAll_JSON(@QueryParam("begin") String sdate, @QueryParam("end") String edate)
{}
e {headers: t, status: 405, statusText: "Method Not Allowed", url: "http://localhost:8080/ConfCallService/api/conference/findaljson", ok: false, …}
error: "<!DOCTYPE html><html><head><title>Apache Tomcat/8.0.24 - Error report</title><style type="text/css">H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}.line {height: 1px; background-color: #525D76; border: none;}</style> </head><body><h1>HTTP Status 405 - Method Not Allowed</h1><div class="line"></div><p><b>type</b> Status report</p><p><b>message</b> <u>Method Not Allowed</u></p><p><b>description</b> <u>The specified HTTP method is not allowed for the requested resource.</u></p><hr class="line"><h3>Apache Tomcat/8.0.24</h3></body></html>"
headers: t {normalizedNames: Map(0), lazyUpdate: null, lazyInit: ƒ}
message: "Http failure response for http://localhost:8080/ConfCallService/api/conference/findaljson: 405 Method Not Allowed"
name: "HttpErrorResponse"
ok: false
status: 405
statusText: "Method Not Allowed"
url: "http://localhost:8080/ConfCallService/api/conference/findaljson"