1

I generate a thrift server with twitter's scrooge,all runs well, but if I include a union type in thrift file, the generating process fails:

[error] Exception in thread "main" com.twitter.scrooge.ParseException: [13.1] failure: string matching regex `\z' expected but `u' found
[error]
[error] union union_value{
[error]
[error] ^
[error]     at com.twitter.scrooge.ScroogeParser.parse(ScroogeParser.scala:227)
[error]     at com.twitter.scrooge.ScroogeParser.parseFile(ScroogeParser.scala:235)
[error]     at com.twitter.scrooge.Main$$anonfun$main$2.apply(Main.scala:92)
[error]     at com.twitter.scrooge.Main$$anonfun$main$2.apply(Main.scala:88)
[error]     at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
[error]     at scala.collection.immutable.List.foreach(List.scala:45)
[error]     at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:30)
[error]     at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:42)
[error]     at com.twitter.scrooge.Main$.main(Main.scala:88)
[error]     at com.twitter.scrooge.Main.main(Main.scala)

below is the versions I choose in my project(you can see my project here):

sbt version : 0.11.2
scala version : 2.9.2
scrooge plugin: addSbtPlugin("com.twitter" %% "sbt11-scrooge" % "3.0.0")
scrooge runtime: "com.twitter" %% "scrooge-runtime" % "3.1.0"

after several attempts, seems that above is the latest scrooge version I can choose.

any advice? Thanks

Fernando Correia
  • 21,803
  • 13
  • 83
  • 116
DiveInto
  • 2,158
  • 3
  • 27
  • 50

1 Answers1

2

Changelog says unions are supported starting with 3.0.1 with some fixes in 3.0.4 and 3.9.1, so the only advice is to find how to update scrooge version. Note that sbt-scrooge allows you to choose Scrooge versions different from default with the scroogeVersion setting.

Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
  • don't know if the version in Changelog is the same with the version here: http://maven.twttr.com/com/twitter/scrooge/, latest version of the former is 3.9.1, while the latter is 3.0.1 – DiveInto Oct 15 '13 at 02:58
  • http://mvnrepository.com/artifact/com.twitter has 3.9.0, so it just seems like maven.twtter.com doesn't get latest versions for some reason. – Alexey Romanov Oct 15 '13 at 06:53