tapestry5tapestry5
I have managed to deploy the cometd demo to tomcat 6.0.36. Source code here https://github.com/uklance/tapestry-cometd-demo
Firstly, I built the war with the "tapestry-test" dependency in my pom.xml. I deployed the war to tomcat and got a similar exception to you (listed below). I unzipped the war file and looked in WEB-INF/lib and noticed that there were two different versions of the jetty jars:
jetty-client-7.6.4.v20120524.jar
jetty-continuation-7.0.0.v20091005.jar
jetty-http-7.0.0.v20091005.jar
jetty-io-7.0.0.v20091005.jar
jetty-jmx-7.6.4.v20120524.jar
jetty-util-7.6.4.v20120524.jar
jetty-websocket-7.6.4.v20120524.jar
As we discussed earlier, I was suspicious that the transitive jetty dependencies in tapestry-test were the culprit. I commented out the tapestry-test dependency in my pom and did a clean build. The jetty jars in the war were now all the same version. Result!
jetty-client-7.6.4.v20120524.jar
jetty-continuation-7.6.4.v20120524.jar
jetty-http-7.6.4.v20120524.jar
jetty-io-7.6.4.v20120524.jar
jetty-jmx-7.6.4.v20120524.jar
jetty-util-7.6.4.v20120524.jar
jetty-websocket-7.6.4.v20120524.jar
So, it seems that even though tapestry-test has a scope of "test", it is still able to affect the dependencies that are included in the war artifact. Maven uses a "nearest declaration wins" strategy when resolving dependencies and I guess that the jetty dependencies coming from tapestry-test are "nearer" than the jetty dependencies coming from tapestry-cometd.
So, I can see two possible fixes:
Remove the "tapestry-test" dependency from your pom.xml if you don't need it
Add 3 dependencies to your pom.xml for "jetty-continuation", "jetty-http" and "jetty-io" specifying version 7.6.4.v20120524.
Here's the error I initially got:
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-35131-1.html
然后可以直接干过去
谢教授正找爹呢