开发者

backward compatibility of play-1.2.3

When upgrading from Play 1.2.1 to 1.2.3, I get some compilation errors. For instance: WsAsync.newRequest takes now two parameter instead of one.

Play 1.2.3 has got two play jars: Play.jar and play-1.2.3.jar. Play.jar seems to have the earlier version of newRequest, and if both jars are added to the build path in eclipse, there are no compilation errors. But when I run Play it seems to only use play-1.2.3.jar. I even tried to copy play.jar to the application lib directory without solving the problem.

Can somebody tell me how to use the two play jars to get backward compatibility?

Neneath the output from 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']


I had problems caused by two different play jar files under play-1.2.3/framework directory.

I compared the file "play/version" in play.jar and play-1.2.3.jar. For play.jar the version file content was "1.1.2" and for play-1.2.3.jar it was "1.2.3" as expected. My conclusion was that play.jar is an old version of the framework and included in the package by mistake, so I solved the case just by deleting play.jar from my play-1.2.3/framework directory.

For the specific incompatibility issue I suggest you just change your code. WsAsync.newRequest was changed already in Play 1.2.2 to

public WSRequest newRequest(String url, String encoding)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜