我在scala-ide(eclipse插件)中开发了一个应用程序,没有错误或警告。现在我正在尝试将其部署到stax云:
$ stax deploy
但它无法编译它:
compile:
[scalac] Compiling 2 source files to /home/gleontiev/workspace/rss2lj/webapp/WEB-INF/classes
error: error while loading FlickrUtils, Scala signature FlickrUtils has wrong version
expected: 4.1
found: 5.0
/home/gleontiev/workspace/rss2lj/src/scala/example/snippet/DisplaySnippet.scala:8: error: com.folone.logic.FlickrUtils does not have a constructor
val dispatcher = new FlickrUtils("8196243@N02")
^
error: error while loading Photo, Scala signature Photo has wrong version
expected: 4.1
found: 5.0
/home/gleontiev/workspace/rss2lj/src/scala/example/snippet/DisplaySnippet.scala:9: error: value link is not a member of com.folone.logic.Photo
val linksGetter = (p:Photo) => p.link
^
/home/gleontiev/workspace/rss2lj/src/scala/example/snippet/DisplaySnippet.scala:15: error: com.folone.logic.FlickrUtils does not have a constructor
val dispatcher = new FlickrUtils("8196243@N02")
^
/home/gleontiev/workspace/rss2lj/src/scala/example/snippet/DisplaySnippet.scala:16: error: value medium1 is not a member of com.folone.logic.Photo
val picsGetter = (p:Photo) => p.medium1
^
/home/gleontiev/workspace/rss2lj/src/scala/example/snippet/RefreshSnippet.scala:12: error: com.folone.logic.FlickrUtils does not have a constructor
val dispatcher = new FlickrUtils("8196243@N02")
^
7 errors found
ERROR: : The following error occurred while executing this line:
/home/gleontiev/workspace/rss2lj/build.xml:61: Compile failed with 7 errors; see the compiler error output for details.
我看到两个错误,它抱怨:第一个是FlickrUtils类构造函数,其定义如下:
class FlickrUtils(val userId : String) {
//...
}
第二个是事实,Photo类中缺少两个字段,即:
class Photo (val photoId:String, val userId:String, val secret:String, val server:String) {
private val _medium1 = "/sizes/m/in/photostream"
val link = "http://flickr.com/photos/" + userId + "/" + photoId
val medium1 = link + _medium1
}
似乎stax sdk使用了错误的comliler(?)。如何使用正确的?如果不是,这里有什么问题,有什么方法可以解决它?
修改: $ scala -version
说
Scala code runner version 2.8.0.final -- Copyright 2002-2010, LAMP/EPFL
我尝试使用scalac
手动编译所有内容,将所有内容放到他们的位置,然后运行stax deploy
- 结果相同。
答案 0 :(得分:1)
我实际上通过将FlickrUtils
和Photo
类移动到最初为片段的包来解决这个问题,但我仍然没有得到,为什么它无法编译并使用它们来自其他包裹。