2016-11-22 56 views
0

我想解析json使用lift-json。我正在关注此链接:http://alvinalexander.com/scala/scala-json-array-parser-parsing-example-lift-json。我遇到以下错误:加载DefaultFormats时发生错误,斯卡拉签名DefaultFormats有错误的版本

error while loading DefaultFormats, Scala signature DefaultFormats has wrong version 
[error] expected: 5.0 
[error] found: 4.1 in DefaultFormats.class 

我该如何摆脱它?

+0

你能否提供你的构建定义? –

回答

0

出现此错误是由于使用了lift-json的错误版本。使用与Scala版本兼容的正确版本。以下依赖固定的问题,由于兼容版本使用Scala 2.11

<dependency> 
     <groupId>net.liftweb</groupId> 
     <artifactId>lift-json_2.11</artifactId> 
     <version>3.0.1</version> 
    </dependency> 

我希望这可以帮助任何人都得到了相同的问题在未来。