[エラー]Ajaxの404
16380 ワード
URLマッピングがそっくりで、結果として404エラーが発生しました.
私はエラーを読んで、webであることに気づいた.xmlでservletを再設定する必要があるようです.
非同期は、複数の場所で実行され、競合する可能性があります.
正確な原因はまだ分からない.
同じチームがwebsocketを使用してビデオチャットとチャットを実現しています.
それはいつも衝突するかららしい.
404エラーは、voが無効であるためエラーである.
VOのフォーマット処理を容易にするために、部長は私に処理中だと教えてくれた.
以下のVOでは、public String getProdInfoNmDisplay()メソッドでprodInfoNmがNull値である場合にも動作するため、Null pointerエラーが発生し404エラーが発生する.
ifがnullの場合を除き,エラーは消えた.
私はエラーを読んで、webであることに気づいた.xmlでservletを再設定する必要があるようです.
非同期は、複数の場所で実行され、競合する可能性があります.
正確な原因はまだ分からない.
同じチームがwebsocketを使用してビデオチャットとチャットを実現しています.
それはいつも衝突するかららしい.
java.lang.IllegalArgumentException: Async support must be enabled on a servlet and for all filters involved in async request processing. This is done in Java code using the Servlet API or by adding "<async-supported>true</async-supported>" to servlet and filter declarations in web.xml. Also you must use a Servlet 3.0+ container
at org.springframework.util.Assert.isTrue(Assert.java:118)
at org.springframework.http.server.ServletServerHttpAsyncRequestControl.<init>(ServletServerHttpAsyncRequestControl.java:61)
at org.springframework.http.server.ServletServerHttpRequest.getAsyncRequestControl(ServletServerHttpRequest.java:224)
at org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.handleInitialRequest(AbstractHttpSockJsSession.java:225)
at org.springframework.web.socket.sockjs.transport.handler.AbstractHttpSendingTransportHandler.handleRequestInternal(AbstractHttpSendingTransportHandler.java:76)
at org.springframework.web.socket.sockjs.transport.handler.HtmlFileTransportHandler.handleRequestInternal(HtmlFileTransportHandler.java:123)
at org.springframework.web.socket.sockjs.transport.handler.AbstractHttpSendingTransportHandler.handleRequest(AbstractHttpSendingTransportHandler.java:66)
at org.springframework.web.socket.sockjs.transport.TransportHandlingSockJsService.handleTransportRequest(TransportHandlingSockJsService.java:313)
at org.springframework.web.socket.sockjs.support.AbstractSockJsService.handleRequest(AbstractSockJsService.java:439)
at org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler.handleRequest(SockJsHttpRequestHandler.java:134)
at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:53)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
WARN : org.springframework.web.servlet.PageNotFound - No mapping for GET /error/Exception
Fri Apr 15 16:47:48 KST 2022 : 3djlakl1 익셉션 발생: Async support must be enabled on a servlet and for all filters involved in async request processing. This is done in Java code using the Servlet API or by adding "<async-supported>true</async-supported>" to servlet and filter declarations in web.xml. Also you must use a Servlet 3.0+ container
4월 15, 2022 4:47:48 오후 org.apache.catalina.core.StandardWrapperValve invoke
심각: Servlet.service() for servlet [appServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.socket.sockjs.SockJsException: Uncaught failure in SockJS request, uri=http://localhost/echo/901/3djlakl1/xhr?t=1650008868508; nested exception is org.springframework.web.socket.sockjs.SockJsTransportFailureException: Failed to open session; nested exception is java.lang.IllegalArgumentException: Async support must be enabled on a servlet and for all filters involved in async request processing. This is done in Java code using the Servlet API or by adding "<async-supported>true</async-supported>" to servlet and filter declarations in web.xml. Also you must use a Servlet 3.0+ container] with root cause
java.lang.IllegalArgumentException: Async support must be enabled on a servlet and for all filters involved in async request processing. This is done in Java code using the Servlet API or by adding "<async-supported>true</async-supported>" to servlet and filter declarations in web.xml. Also you must use a Servlet 3.0+ container
at org.springframework.util.Assert.isTrue(Assert.java:118)
at org.springframework.http.server.ServletServerHttpAsyncRequestControl.<init>(ServletServerHttpAsyncRequestControl.java:61)
at org.springframework.http.server.ServletServerHttpRequest.getAsyncRequestControl(ServletServerHttpRequest.java:224)
at org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.handleInitialRequest(AbstractHttpSockJsSession.java:225)
at org.springframework.web.socket.sockjs.transport.handler.AbstractHttpSendingTransportHandler.handleRequestInternal(AbstractHttpSendingTransportHandler.java:76)
at org.springframework.web.socket.sockjs.transport.handler.AbstractHttpSendingTransportHandler.handleRequest(AbstractHttpSendingTransportHandler.java:66)
at org.springframework.web.socket.sockjs.transport.TransportHandlingSockJsService.handleTransportRequest(TransportHandlingSockJsService.java:313)
at org.springframework.web.socket.sockjs.support.AbstractSockJsService.handleRequest(AbstractSockJsService.java:439)
at org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler.handleRequest(SockJsHttpRequestHandler.java:134)
at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:53)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
=>このエラーはwebsocketの問題です.404エラーは、voが無効であるためエラーである.
VOのフォーマット処理を容易にするために、部長は私に処理中だと教えてくれた.
以下のVOでは、public String getProdInfoNmDisplay()メソッドでprodInfoNmがNull値である場合にも動作するため、Null pointerエラーが発生し404エラーが発生する.
ifがnullの場合を除き,エラーは消えた.
package kr.or.tco.ordr.vo;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Repository;
@Repository
public class OrdrVO {
private int ordrId ; //발주아이디
private String prodInfoId ; //상품아이디
private int ordrQty ; //발주수량
private Date ordrDt ; //발주일
private String brncofcId ; //발주지점
private String brncofcNm ; //발주지점
private String ordrSe ; //발주구분
private String ordrYn ; //수주여부
private String prodInfoNm ; //상품명
private int prodInfoPrchsAmt; //상품매입가격
private String ordrWhyn ; //상품입고여부
private String condition ; //모든상품 입고여부
public String getOrderAmount() { //상품매입가격 * 발주수량
String res = new DecimalFormat("#,###").format(prodInfoPrchsAmt * ordrQty);
res = res + "원";
return res;
}
public String getProdInfoPrchsAmtDisplay() { //상품매입가격
String res = new DecimalFormat("#,###").format(prodInfoPrchsAmt);
res = res + "원";
return res;
}
public String getOrdrQtyDisplay() { //발주수량
String res = new DecimalFormat("#,###").format(ordrQty);
return res;
}
public String getProdInfoNmDisplay() { //상품명
String res = "";
if(prodInfoNm!=null) {
res = this.prodInfoNm.replaceAll("_", " ");
return res;
}
return res;
}
public String getOrdrDtDisplay() { //입고날짜
String ordrDtDisplay = "";
if(this.ordrDt != null) {
ordrDtDisplay = new SimpleDateFormat("YYYY-MM-dd").format(this.ordrDt);
}
return ordrDtDisplay;
}
public void setOrdrDtDisplay(String ordrDtDisplay) {
if(ordrDt != null) {
try {
this.ordrDt = new SimpleDateFormat("yyyy-MM-dd").parse(ordrDtDisplay);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
public int getOrdrId() {
return ordrId;
}
public void setOrdrId(int ordrId) {
this.ordrId = ordrId;
}
public String getProdInfoId() {
return prodInfoId;
}
public void setProdInfoId(String prodInfoId) {
this.prodInfoId = prodInfoId;
}
public int getOrdrQty() {
return ordrQty;
}
public void setOrdrQty(int ordrQty) {
this.ordrQty = ordrQty;
}
public Date getOrdrDt() {
return ordrDt;
}
public void setOrdrDt(Date ordrDt) {
this.ordrDt = ordrDt;
}
public String getBrncofcId() {
return brncofcId;
}
public void setBrncofcId(String brncofcId) {
this.brncofcId = brncofcId;
}
public String getOrdrSe() {
return ordrSe;
}
public void setOrdrSe(String ordrSe) {
this.ordrSe = ordrSe;
}
public String getOrdrYn() {
return ordrYn;
}
public void setOrdrYn(String ordrYn) {
this.ordrYn = ordrYn;
}
public String getProdInfoNm() {
return prodInfoNm;
}
public void setProdInfoNm(String prodInfoNm) {
this.prodInfoNm = prodInfoNm;
}
public int getProdInfoPrchsAmt() {
return prodInfoPrchsAmt;
}
public void setProdInfoPrchsAmt(int prodInfoPrchsAmt) {
this.prodInfoPrchsAmt = prodInfoPrchsAmt;
}
public String getBrncofcNm() {
return brncofcNm;
}
public void setBrncofcNm(String brncofcNm) {
this.brncofcNm = brncofcNm;
}
public String getOrdrWhyn() {
return ordrWhyn;
}
public void setOrdrWhyn(String ordrWhyn) {
this.ordrWhyn = ordrWhyn;
}
public String getCondition() {
return condition;
}
public void setCondition(String condition) {
this.condition = condition;
}
@Override
public String toString() {
return "OrdrVO [ordrId=" + ordrId + ", prodInfoId=" + prodInfoId + ", ordrQty=" + ordrQty + ", ordrDt=" + ordrDt
+ ", brncofcId=" + brncofcId + ", brncofcNm=" + brncofcNm + ", ordrSe=" + ordrSe + ", ordrYn=" + ordrYn
+ ", prodInfoNm=" + prodInfoNm + ", prodInfoPrchsAmt=" + prodInfoPrchsAmt + ", ordrWhyn=" + ordrWhyn
+ ", condition=" + condition + "]";
}
}
Reference
この問題について([エラー]Ajaxの404), 我々は、より多くの情報をここで見つけました https://velog.io/@gksmf6699/오류-Ajax에서-404テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol