从Play 1.2.1升级到1.2.3时,出现了一些编译错误。例如:WsAsync.newRequest
现在采用两个参数而不是一个参数。
Play 1.2.3有两个游戏罐:Play.jar和play-1.2.3.jar。 Play.jar似乎有早期版本的newRequest
,如果两个jar都添加到eclipse中的构建路径,则没有编译错误。但是当我运行Play时,似乎只使用play-1.2.3.jar。我甚至试图将play.jar复制到应用程序lib目录而不解决问题。
有人可以告诉我如何使用这两个游戏罐来获得向后兼容性吗?
play classpath
的输出下方:
hh@ubuntu10:/disk2/dba/lib$ /disk2/play-1.2.3/play classpath --%test-hh
~ _ _
~ _ __ | | __ _ _ _| |
~ | '_ \| |/ _' | || |_|
~ | __/|_|\____|\__ (_)
~ |_| |__/
~
~ play! 1.2.3, http://www.playframework.org
~ framework ID is test-hh
~
~ Computed classpath is:
~
['/disk2/dba/lib/conf', '/disk2/play-1.2.3/framework/play-1.2.3.jar', '/disk2/play-1.2.3/modules/testrunner/lib/play-testrunner.jar', '/disk2/play-1.2.3/framework/lib/hibernate-core-3.6.1.Final.jar', '/disk2/play-1.2.3/framework/lib/activation-1.1.1.jar', '/disk2/play-1.2.3/framework/lib/commons-beanutils-1.8.3.jar', '/disk2/play-1.2.3/framework/lib/javassist-3.9.0.GA.jar', '/disk2/play-1.2.3/framework/lib/jj-simplecaptcha.jar', '/disk2/play-1.2.3/framework/lib/javax.inject-1.0.jar', '/disk2/play-1.2.3/framework/lib/hibernate-jpa-2.0-api-1.0.0.Final.jar', '/disk2/play-1.2.3/framework/lib/commons-email-1.2.jar', '/disk2/play-1.2.3/framework/lib/groovy-all-1.7.7.jar', '/disk2/play-1.2.3/framework/lib/jj-wikitext.jar', '/disk2/play-1.2.3/framework/lib/log4j-1.2.15.jar', '/disk2/play-1.2.3/framework/lib/jj-textile.jar', '/disk2/play-1.2.3/framework/lib/dom4j-1.6.1.jar', '/disk2/play-1.2.3/framework/lib/ehcache-core-2.0.0.jar', '/disk2/play-1.2.3/framework/lib/ivy-2.2.0.jar', '/disk2/play-1.2.3/framework/lib/signpost-core-1.2.jar', '/disk2/play-1.2.3/framework/lib/commons-collections-3.2.1.jar', '/disk2/play-1.2.3/framework/lib/slf4j-log4j12-1.6.1.jar', '/disk2/play-1.2.3/framework/lib/jamon-2.7.jar', '/disk2/play-1.2.3/framework/lib/postgresql-9.0.jar', '/disk2/play-1.2.3/framework/lib/antlr-2.7.6.jar', '/disk2/play-1.2.3/framework/lib/asm-all-3.3.1.jar', '/disk2/play-1.2.3/framework/lib/mysql-connector-java-5.1.13.jar', '/disk2/play-1.2.3/framework/lib/jj-imaging.jar', '/disk2/play-1.2.3/framework/lib/xstream-1.3.jar', '/disk2/play-1.2.3/framework/lib/commons-logging-1.1.1.jar', '/disk2/play-1.2.3/framework/lib/joda-time-1.6.jar', '/disk2/play-1.2.3/framework/lib/snakeyaml-1.7.jar', '/disk2/play-1.2.3/framework/lib/commons-lang-2.6.jar', '/disk2/play-1.2.3/framework/lib/ezmorph-1.0.3.jar', '/disk2/play-1.2.3/framework/lib/cglib-nodep-2.2.jar', '/disk2/play-1.2.3/framework/lib/hibernate-commons-annotations-3.2.0.Final.jar', '/disk2/play-1.2.3/framework/lib/jta-1.1.jar', '/disk2/play-1.2.3/framework/lib/org.eclipse.jdt.core-3.6.0.jar', '/disk2/play-1.2.3/framework/lib/geronimo-servlet_2.5_spec-1.2.jar', '/disk2/play-1.2.3/framework/lib/jaxen-1.1.jar', '/disk2/play-1.2.3/framework/lib/junit-4.8.1.jar', '/disk2/play-1.2.3/framework/lib/oval-1.50.jar', '/disk2/play-1.2.3/framework/lib/jregex-1.2_01.jar', '/disk2/play-1.2.3/framework/lib/slf4j-api-1.6.1.jar', '/disk2/play-1.2.3/framework/lib/bcprov-jdk15-1.45.jar', '/disk2/play-1.2.3/framework/lib/commons-fileupload-1.2.2.jar', '/disk2/play-1.2.3/framework/lib/c3p0-0.9.1.2.jar', '/disk2/play-1.2.3/framework/lib/jsr107cache-1.0.jar', '/disk2/play-1.2.3/framework/lib/commons-io-2.0.1.jar', '/disk2/play-1.2.3/framework/lib/mail-1.4.3.jar', '/disk2/play-1.2.3/framework/lib/commons-javaflow-1066591.jar', '/disk2/play-1.2.3/framework/lib/hibernate-entitymanager-3.6.0.Final.jar', '/disk2/play-1.2.3/framework/lib/memcached-2.6.jar', '/disk2/play-1.2.3/framework/lib/commons-codec-1.4.jar', '/disk2/play-1.2.3/framework/lib/netty-3.2.4.Final.jar', '/disk2/play-1.2.3/framework/lib/h2-1.3.149.jar', '/disk2/play-1.2.3/framework/lib/gson-1.7.1.jar', '/disk2/play-1.2.3/framework/lib/async-http-client-1.6.3.jar']
答案 0 :(得分:0)
我遇到了play-1.2.3 / framework目录下两个不同的播放jar文件引起的问题。
我比较了play.jar和play-1.2.3.jar中的文件“play / version”。对于play.jar,版本文件内容为“1.1.2”,对于play-1.2.3.jar,如预期的那样为“1.2.3”。我的结论是play.jar是框架的旧版本并且错误地包含在包中,所以我通过从play-1.2.3 / framework目录中删除play.jar来解决这个问题。
对于特定的不兼容问题,我建议您更改代码。 WsAsync.newRequest已在Play 1.2.2中更改为
public WSRequest newRequest(String url, String encoding)