Я получил следующую ошибку из java-приложения, работающего на tomcat, при попытке отправить POST-запрос из приложения angular 5 в java-приложение с использованием служб restful:
23: 26: 22,191 ОШИБКА [BaseXMLFilter]Исключение в цепочке фильтров javax.servlet.ServletException: выполнение сервлета вызвало исключение в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:326) в org.apache.catalina.core.ApplicationFilterCha.Java: 208) в org.apache.tomcat.websocket.server.WsFilter.doFilter (WsFilter.java:52) в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:241) в org..core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:208) в com.thetransactioncompany.cors.CORSFilter.doFilter (CORSFilter.java:198) в com.thetransactioncompany.cors.CORSFilter.doFilter или CORF: 42:24.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:241) в org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:208) в org.jboss.seam.servlet.SeamFilter $ FilterChainImpl.org.jboss.seam.web.RewriteFilter.doFilter (RewriteFilter.java:63) в org.jboss.seam.servlet.SeamFilter $ FilterChainImpl.doFilter (SeamFilter.java:69) в org.jboss.IamityFilter.doFilter (IdentityFilter.java:40) в org.jboss.seam.servlet.SeamFilter $ FilterChainImpl.doFilter (SeamFilter.java:69) в org.jboss.seam.servlet.SeamFilter $ FilterChainImpl.doFilter (SejFilter).в org.jboss.seam.web.ExceptionFilter.doFilter (ExceptionFilter.java:64) в org.jboss.seam.servlet.SeamFilter $ FilterChainImpl.doFilter (SeamFilter.java:69) в org.jboss.seam.Felter.Feter..doFilter (RedirectFilter.java:45) в org.jboss.seam.servlet.SeamFilter $ FilterChainImpl.doFilter (SeamFilter.java:69) в org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter (BaseXg:20: atjg:20:20:g:20:20:20:20:20:20:20:20:20:20:20:20:20:20:20: 20Аякса4jsf.webapp.BaseFilter.handleRequest (BaseFilter.java:290) в org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest (BaseFilter.java:388) в org.ajax4jsf.webava.FilterFilterFilterFilterFilterFilterFilterFilter.jboss.seam.web.Ajax4jsfFilter.doFilter (Ajax4jsfFilter.java:56) в org.jboss.seam.servlet.SeamFilter $ FilterChainImpl.doFilter (SeamFilter.java:69) в org.jilboss.sebof.(LoggingFilter.java:60) в org.jboss.seam.servlet.SeamFilter $ FilterChainImpl.doFilter (SeamFilter.java:69) в org.jboss.seam.servlet.SeamFilter.doFilter (SeamFilter.java:158 at).apache.catalina.core.Java: 219) в org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:110) в org.apache.catalina.authenticator.AuthenticatorBase.invoke (AuthenticatorBase.java:498) в org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:169) в org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.javag: 10).catalina.valves.AccessLogValve.invoke (AccessLogValve.java:962) в org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:116) в org.apache.catalina.connector.serapeterjj.: 445) в org.apache.coyote.http11.AbstractHttp11Processor.process (AbstractHttp11Processor.java:1115) в org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process (AbstractProtocol.java:637) в org.apachetom.net.JIoEndpoint $ SocketProcessor.run (JIoEndpoint.java:318)в java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145) в java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:615) в org.apache.treadcatTra.run (TaskThread.java:61) at java.lang.Thread.run (Thread.java:745)
Причина: java.lang.AbstractMethodError: javax.ws.rs.core.Response.getStatusInfo () Ljavax / ws / rs / core / Response $ StatusType; в javax.ws.rs.WebApplicationException.computeExceptionMessage (WebApplicationException.java:211) в javax.ws.rs.WebApplicationException. (WebApplicationException.: 185) at org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.readFrom (AbstractJAXBProvider.java:89) at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.prol.jj).jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.read (GZIPDecodingInterceptor.java:46) в org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed (MessageBodyReaderContextImpl.java:108) по адресу org.jboss.resteasy.core.messagebody.ReaderUtility.doRead (ReaderUtility.java:106) по адресу org.jboss.resteasy.core.messagebody.ReaderUader::93) в org.jboss.resteasy.core.MessageBodyParameterInjector.inject (MessageBodyParameterInjector.java:120) в org.jboss.resteasy.core.MethodInjectorImpl.injectArguments (MethodInjectorImpl.java:93) в org.jt..invoke (MethodInjectorImpl.java:116) в org.jboss.resteasy.core.ResourceMethod.invokeOnTarget (ResourceMethod.java:211) в org.jboss.resteasy.core.ResourceMethod.invoke (ResourceMethod).jboss.resteasy.core.ResourceMethod.invoke (ResourceMethod.java:166) в org.jboss.resteasy.core.SynchronousDispatcher.getResponse (SynchronousDispatcher.java:359) в org.jboss.resteasy.chronispatcher (синхронный поиск).Java: 336) в org.jboss.resteasy.core.SynchronousDispatcher.invoke (SynchronousDispatcher.java:103)по адресу org.jboss.seam.resteasy.ResteasyResourceAdapter $ 1.process (ResteasyResourceAdapter.java:145) по адресу org.jboss.seam.servlet.ContextualHttpServletRequest.run (ContextualHttpServletRequest.jameseste.serse.teser.teser.teser.teser.tete) atseasy.getResource (ResteasyResourceAdapter.java:121) в org.jboss.seam.servlet.SeamResourceServlet.service (SeamResourceServlet.java:80) в javax.servlet.http.HttpServlet.service (HttpServlet.cat.t).core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:303) ... еще 44 сентября 26, 2018 23:26:22 PM org.apache.catalina.core.StandardWrapperValve вызывает
SEVERE: Servlet.service () для сервлета [Seam Resource Servlet] в контексте с путем [/ jboss-seam-jpa] выдало исключение [Выполнение сервлета выдало исключение] с первопричиной java.lang.AbstractMethodError: javax.ws.rs.core.Response.getStatusInfo () Ljavax / ws / rs / core / Response $ StatusType; в javax.ws.rs.WebApplicationException.computeExceptionMessage (МыbApplicationException.java:211) в javax.ws.rs.WebApplicationException. (WebApplicationException.java:185) в org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.readFrom (AbstractJAXBProvider.java: at) .java:resteasy.core.interception.MessageBodyReaderContextImpl.proceed (MessageBodyReaderContextImpl.java:108) в org.jboss.resteasy.core.messagebody.ReaderUtility.doRead (ReaderUtility.java:106) в org.jboss.resteasy.core.meavaageaderRe.jj (Reader): Reader (Reader): Reader93)в org.jboss.resteasy.core.MessageBodyParameterInjector.inject (MessageBodyParameterInjector.java:120) в org.jboss.resteasy.core.MethodInjectorImpl.injectArguments (MethodInjectorImpl.java:93) в org.jboin(MethodInjectorImpl.java:116) в org.jboss.resteasy.core.ResourceMethod.invokeOnTarget (ResourceMethod.java:211) в org.jboss.resteasy.core.ResourceMethod.invoke (ResourceMethod.j.bo.java.java: 17: org.resteasy.core.ResourceMethod.invoke (ResourceMethod.java:166) в org.jboss.resteasy.core.SynchronousDispatcher.getResponse (SynchronousDispatcher.java:359) в org.jboss.resteasy.patore.SynchroninDis (336) в org.jboss.resteasy.core.SynchronousDispatcher.invoke (SynchronousDispatcher.java:103) в org.jboss.seam.resteasy.ResteasyResourceAdapter $ 1.process (ResteasyResourceAdapter.java:145) в org.jlet.ContextualHttpServletRequest.run (ContextualHttpServletRequest.java:53) в org.jboss.seam.resteasy.ResteasyResourceAdapter.getResource (ResteasyResourceAdapter.java:121) по адресу org.jboss.seam.servlet.SeamResourceServlet.service (SeamResourceServlet.java:80) по адресу javax.servlet.http.HttpServlet.service: ort..catalina.core..java: 52) в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:241) в org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.jany:20caction.company.CORSFilter.doFilter (CORSFilter.java:198) в com.thetransactioncompany.cors.CORSFilter.doFilter (CORSFilter.java:244) в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilg: 24) atacheg:.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:208) в org.jboss.seam.servlet.SeamFilter $ FilterChainImpl.doFilter (SeamFilter.java:83) в org.jboss.seam.web.RewriteFilter.doFilter (RewriteFilter.java:63) в орг..seam.servlet.SeamFilter $ FilterChainImpl.doFilter (SeamFilter.java:69) в org.jboss.seam.web.IdentityFilter.doFilter (IdentityFilter.java:40) в org.jboss.seam.servlet.SeamFilter $(SeamFilter.java:69) в org.jboss.seam.servlet.SeamFilter $ FilterChainImpl.doFilter (SeamFilter.java:73) в org.jboss.seam.web.ExceptionFilter.doFilter (ExceptionFilter.java:64) в org.jboss.seam.servlet.SeamFilter $ FilterChainImpl.doFilter (SeamFilter.java:69) в org.jboss.seam.web.RedirectFilter.doFilter (RedirectFilter.java:45) в org.jboss.seam.servlet.lhaha .SamFamdoFilter (SeamFilter.java:69) по адресу org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter (BaseXMLFilter.java:206) по адресу org.ajax4jsf.webapp.BaseFilter.handleRequest (BaseFilter.jaxsf.jave.fweter.jb.jf.jf.jf.j_jg_15).processUploadsAndHandleRequest (BaseFilter.java:388) в org.ajax4jsf.webapp.BaseFilter.doFilter (BaseFilter.java:515) в org.jboss.seam.web.Ajax4jsfFilter.doFilter (Ajax4jsfFilter.java:56bose.java:jbo)..SeamFilter $ FilterChainImpl.doFilter (SeamFilter.java:69) в org.jboss.seam.web.LoggingFilter.doFilter (LoggingFilter.java:60) в org.jboss.seam.servlet.SeamFilter $ FilterChafin: 69) в org.jboss.seam.servlet.SeamFilter.doFilter (SeamFilter.java:158) в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:241) в org.apache.catinaApplicationFilterChain.doFilter (ApplicationFilterChain.java:208) в org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:219)в org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:110) в org.apache.catalina.authenticator.AuthenticatorBase.invoke (AuthenticatorBase.java:498) в org.apache.catalnd.core(StandardHostValve.java:169) в org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:103) в org.apache.catalina.valves.AccessLogValve.invoke (AccessLogValve.java:96ap) в org.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:116) в org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:445) в org.apache.coyote.http11.AcesscessHotProcess (ProgressHttpPro11 (ProcessorHttp11).1115) в org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process (AbstractProtocol.java:637) в org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run (JIoEndpoint.java:318) в java.util.concrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145) в java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:615) в org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run (TaskThread.java:61) в java.lang.Thread.run (Thread.java:745)
Код приложения Angular 5:
const httpOptions = {
headers: new HttpHeaders({ 'Accept': 'application/json', 'Content-Type': 'application/json' })
};
private baseUrl = 'http://localhost:8080/jboss-seam-jpa/seam/resource/rest';
addLocation(locationTemp: Location): Observable<any> {
return this.http.post(`${this.baseUrl}/Trips/Location`, JSON.stringify(locationTemp), httpOptions);
}
Код Java:
@POST
@Path("Location")
@Consumes("application/json")
public Response addLocation(Location location) {
myDao.addLocation(location);
return Response.ok().entity("Location added successfully").build();
}
Полная библиотека jars из приложения java:
Заранее спасибо!