英文:
java.lang.IllegalStateException: Unable to find match between the canonical context path
问题
java.lang.IllegalStateException: 在将一些Spring项目从Spring 2迁移到Spring 3.0.4时,我看到大多数项目都在Rest调用中通信。对于某些请求,我收到以下错误。
Unable to find match between the canonical context path [/servicename] and the URI presented by the user agent [_visitor=.......]
在直接调用API(使用Postman)时正常工作。但是当通过另一个服务调用时失败。
Tomcat版本解析为Apache Tomcat/10.1.5
您能帮忙找出可能的问题吗?
我回退到以前的Spring 2.*版本,一切正常。
英文:
I am migrating some of my spring projects from Spring 2 to spring 3.0.4. Most of them are communicating within Rest calls. I see for some requests I am getting the below error .
java.lang.IllegalStateException: Unable to find match between the canonical context path [/servicename] and the URI presented by the user agent [_visitor=.......]
at org.apache.catalina.connector.Request.getContextPath(Request.java:2152)
at org.apache.catalina.connector.RequestFacade.getContextPath(RequestFacade.java:784)
at org.apache.catalina.core.ApplicationDispatcher.wrapRequest(ApplicationDispatcher.java:896)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:341)
If the API is called directly (using postman) its working. but when called through another service its failing.
Tomcat version resolved is Apache Tomcat/10.1.5
Could you pls help what could be the issue?
I rolled back to the previous Spring 2.* version and it works fine.
答案1
得分: 0
如果API是直接调用的(使用postman),它可以正常工作。但当通过另一个服务调用时,它失败了。
我认为你可以先学习HTTP协议和HTTP数据包格式,然后使用一些数据包捕获工具(如tcpdump或wireshark)来捕获HTTP请求数据包,然后分析Postman的请求与其他服务的请求之间的差异。
英文:
> If the API is called directly (using postman) its working. but when called through another service its failing.
I think you can learn HTTP protocol and HTTP packet format first, then use some packet capture tools (such as tcpdump or wireshark) to capture HTTP request packets, and then analyze the difference between Postman's requests and those of other services.
答案2
得分: 0
你可能受到Tomcat bug #66488的影响。尝试升级到Tomcat 10.0.7,看看你的体验是否有所改善。
英文:
You may be affect by Tomcat bug #66488. Try upgrading to Tomcat 10.0.7 and see if your experience improves.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论