Request processing failed; nested exception is com.sun.jersey.api.client.UniformInterfaceException:

SpringMVC建了两个TomCat服务器模拟跨服务器传文件,出现了Request processing failed; nested exception is com.sun.jersey.api.client.UniformInterfaceException: PUT http://localhost:9090/fileupload_war/uploads/111.png returned a response status of 405 Method Not Allowed 这个错误

百度一查才知道,原来tomcat中 readonly 这个参数默认为true,即禁止delete和put操作,难怪会出问题

解决:需要在Tomcat目录下的conf文件夹下的web.xml中加入,再重启tomcat就可以啦

<init-param>
        <param-name>readonly</param-name>
        <param-value>false</param-value>
     </init-param>

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_40181435/article/details/105684221