When running Mule ESB 3.2.1 as embedded server inside Tomcat 7.0.27 (executed with webapp-runner), during execution of a flow with the Http endpoint, while sending response back to caller, an Exception is raised:java.lang.NoSuchMethodError: org.apache.tomcat.util.http.ServerCookie.appendCookieValue(Ljava/lang/StringBuffer;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZ)V以下异常:org.mule.api.MuleRuntimeException: Connector that caused exception is: connector.http.mule.default at org.mule.transport.AbstractConnector.handleWorkException(AbstractConnector.java:2034) at org.mule.transport.AbstractConnector.workCompleted(AbstractConnector.java:1998) at org.mule.work.WorkerContext.run(WorkerContext.java:369) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)Caused by: java.lang.NoSuchMethodError: org.apache.tomcat.util.http.ServerCookie.appendCookieValue(Ljava/lang/StringBuffer;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZ)V at org.mule.transport.http.CookieHelper.formatCookieForASetCookieHeader(CookieHelper.java:310) at org.mule.transport.http.transformers.MuleMessageToHttpResponse.createResponse(MuleMessageToHttpResponse.java:261) at org.mule.transport.http.transformers.MuleMessageToHttpResponse.transformMessage(MuleMessageToHttpResponse.java:90) at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:145) at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:93) at org.mule.DefaultMuleMessage.applyAllTransformers(DefaultMuleMessage.java:1387) at org.mule.DefaultMuleMessage.applyTransformers(DefaultMuleMessage.java:1348) at org.mule.DefaultMuleMessage.applyTransformers(DefaultMuleMessage.java:1331) at org.mule.transport.AbstractMessageReceiver.applyResponseTransformers(AbstractMessageReceiver.java:235) at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:214) at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:163) at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:150) at org.mule.transport.http.HttpMessageReceiver$HttpWorker.doRequest(HttpMessageReceiver.java:299) at org.mule.transport.http.HttpMessageReceiver$HttpWorker.processRequest(HttpMessageReceiver.java:258) at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:163) at org.mule.work.WorkerContext.run(WorkerContext.java:310)推荐答案我也遇到了这个问题.在此处查看答案.I had this problem too. Check answer here. Mule ESB不适用于cookie 简而言之,请确保为m子3.7.0提供了组:"org.apache.tomcat",名称:土狼",版本:"6.0.44".In short, make sure you have provided group: 'org.apache.tomcat', name: 'coyote', version: '6.0.44' for mule 3.7.0.在您的情况下,您应该拥有另一个库- tomcat-util 5.5.23 ,因为您使用的是不同版本的m子 3.2.1 .In your case, you should have another library - tomcat-util 5.5.23 because you use different version of mule 3.2.1. compile group: 'tomcat', name: 'tomcat-util', version: '5.5.23' 当您使用SpringBoot时,它会确认某些库的版本(取决于Spring和Mule的版本),因此您将收到此错误.您具有类ServerCookie,但是方法appendCookieValue将消失! When you use SpringBoot, it ovverides a version of some library (depending on version of Spring and Mule), so you will get this error. You have class ServerCookie but the method appendCookieValue will disappear! 解决方案-使用库.或其他坏解决方法,编写您自己的其中一个失败的类的版本,并确保classloader将使用您的类的版本. (同样,用相同的名称和程序包创建一个类来修复错误-是一件危险且不好的事情……)Solution - play with libraries. Or another bad workaround, write your own version of one of these classes that fail, and make sure classloader will use your version of the classes. (Again, creating a class with the same name and package to fix a bug - is a risky and bad thing...) 这篇关于执行http:set-cookie时,Tomcat嵌入式MULE中出现NoSuchMethodError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-27 11:42