问题
My Play 2.1.1 project uses SBT 0.12.3, and when compiling it on my dev machine, everything's fine, I get no errors, and the app runs without any issues. When I try to compile it on an EC2 instance used for testing, I get the superlong error message below. The only possibly relevant difference between the two environments is that I have java 6 (1.6.0_45) on my dev machine, and java 7 (1.7.0_19) on EC2, but I can't currently change neither. Have you ever seen something like this? What can this be about? Thanks!
[error] uncaught exception during compilation: java.lang.AssertionError
[error] (compile:compile) java.lang.AssertionError: assertion failed:
[error] while compiling: /home/ec2-user/chat/target/scala-2.10/src_managed/main/routes_routing.scala
[error] during phase: jvm
[error] library version: version 2.10.0
[error] compiler version: version 2.10.0
[error] reconstructed args: -classpath /home/ec2-user/chat/target/scala-2.10/classes:/home/ec2-user/play-2.1.1/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/play/sbt-link/2.1.1/jars/sbt-link.jar:/home/ec2-user/play-2.1.1/repository/local/org.javassist/javassist/3.16.1-GA/jars/javassist.jar:/home/ec2-user/play-2.1.1/repository/local/play/play-exceptions/2.1.1/jars/play-exceptions.jar:/home/ec2-user/play-2.1.1/repository/local/play/templates_2.10/2.1.1/jars/templates_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/com.github.scala-incubator.io/scala-io-file_2.10/0.4.2/jars/scala-io-file_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/com.github.scala-incubator.io/scala-io-core_2.10/0.4.2/jars/scala-io-core_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/com.jsuereth/scala-arm_2.10/1.3/jars/scala-arm_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/play/play-iteratees_2.10/2.1.1/jars/play-iteratees_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/org.scala-stm/scala-stm_2.10.0/0.6/jars/scala-stm_2.10.0.jar:/home/ec2-user/play-2.1.1/repository/local/com.typesafe/config/1.0.0/bundles/config.jar:/home/ec2-user/play-2.1.1/repository/local/org.slf4j/jul-to-slf4j/1.6.6/jars/jul-to-slf4j.jar:/home/ec2-user/play-2.1.1/repository/local/org.slf4j/jcl-over-slf4j/1.6.6/jars/jcl-over-slf4j.jar:/home/ec2-user/play-2.1.1/repository/local/com.typesafe.akka/akka-actor_2.10/2.1.0/bundles/akka-actor_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/com.typesafe.akka/akka-slf4j_2.10/2.1.0/bundles/akka-slf4j_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/joda-time/joda-time/2.1/jars/joda-time.jar:/home/ec2-user/play-2.1.1/repository/local/org.joda/joda-convert/1.2/jars/joda-convert.jar:/home/ec2-user/play-2.1.1/repository/local/org.apache.commons/commons-lang3/3.1/jars/commons-lang3.jar:/home/ec2-user/play-2.1.1/repository/local/com.ning/async-http-client/1.7.6/jars/async-http-client.jar:/home/ec2-user/play-2.1.1/repository/local/oauth.signpost/signpost-core/1.2.1.2/jars/signpost-core.jar:/home/ec2-user/play-2.1.1/repository/local/oauth.signpost/signpost-commonshttp4/1.2.1.2/jars/signpost-commonshttp4.jar:/home/ec2-user/play-2.1.1/repository/local/org.apache.httpcomponents/httpcore/4.0.1/jars/httpcore.jar:/home/ec2-user/play-2.1.1/repository/local/org.apache.httpcomponents/httpclient/4.0.1/jars/httpclient.jar:/home/ec2-user/play-2.1.1/repository/local/commons-logging/commons-logging/1.1.1/jars/commons-logging.jar:/home/ec2-user/play-2.1.1/repository/local/org.codehaus.jackson/jackson-core-asl/1.9.10/jars/jackson-core-asl.jar:/home/ec2-user/play-2.1.1/repository/local/org.codehaus.jackson/jackson-mapper-asl/1.9.10/jars/jackson-mapper-asl.jar:/home/ec2-user/play-2.1.1/repository/local/net.sf.ehcache/ehcache-core/2.6.0/jars/ehcache-core.jar:/home/ec2-user/play-2.1.1/repository/local/javax.transaction/jta/1.1/jars/jta.jar:/home/ec2-user/play-2.1.1/repository/local/org.scala-lang/scala-reflect/2.10.0/jars/scala-reflect.jar:/home/ec2-user/play-2.1.1/repository/local/play/play-jdbc_2.10/2.1.1/jars/play-jdbc_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/play/play-java_2.10/2.1.1/jars/play-java_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/org.yaml/snakeyaml/1.10/bundles/snakeyaml.jar:/home/ec2-user/play-2.1.1/repository/local/org.hibernate/hibernate-validator/4.3.0.Final/jars/hibernate-validator.jar:/home/ec2-user/play-2.1.1/repository/local/javax.validation/validation-api/1.0.0.GA/jars/validation-api.jar:/home/ec2-user/play-2.1.1/repository/local/org.jboss.logging/jboss-logging/3.1.0.CR2/jars/jboss-logging.jar:/home/ec2-user/play-2.1.1/repository/local/org.springframework/spring-context/3.1.2.RELEASE/jars/spring-context.jar:/home/ec2-user/play-2.1.1/repository/local/org.springframework/spring-core/3.1.2.RELEASE/jars/spring-core.jar:/home/ec2-user/play-2.1.1/repository/local/org.springframework/spring-beans/3.1.2.RELEASE/jars/spring-beans.jar:/home/ec2-user/play-2.1.1/repository/local/org.reflections/reflections/0.9.8/jars/reflections.jar:/home/ec2-user/play-2.1.1/repository/local/com.google.guava/guava/13.0.1/jars/guava.jar:/home/ec2-user/play-2.1.1/repository/local/com.google.code.findbugs/jsr305/2.0.1/jars/jsr305.jar:/home/ec2-user/play-2.1.1/repository/local/javax.servlet/javax.servlet-api/3.0.1/jars/javax.servlet-api.jar:/home/ec2-user/play-2.1.1/repository/local/com.jolbox/bonecp/0.7.1.RELEASE/bundles/bonecp.jar:/home/ec2-user/play-2.1.1/repository/local/com.h2database/h2/1.3.168/jars/h2.jar:/home/ec2-user/play-2.1.1/repository/local/tyrex/tyrex/1.0.1/jars/tyrex.jar:/home/ec2-user/play-2.1.1/repository/local/play/anorm_2.10/2.1.1/jars/anorm_2.10.jar:/home/ec2-user/play-2.1.1/repository/cache/org.reactivemongo/play2-reactivemongo_2.10/jars/play2-reactivemongo_2.10-0.9.jar:/home/ec2-user/play-2.1.1/repository/cache/org.reactivemongo/reactivemongo_2.10/jars/reactivemongo_2.10-0.9.jar:/home/ec2-user/play-2.1.1/repository/cache/org.reactivemongo/reactivemongo-bson-macros_2.10/jars/reactivemongo-bson-macros_2.10-0.9.jar:/home/ec2-user/play-2.1.1/repository/cache/org.reactivemongo/reactivemongo-bson_2.10/jars/reactivemongo-bson_2.10-0.9.jar:/home/ec2-user/play-2.1.1/framework/sbt/boot/scala-2.10.0/lib/scala-compiler.jar:/home/ec2-user/play-2.1.1/repository/cache/io.netty/netty/bundles/netty-3.6.5.Final.jar:/home/ec2-user/play-2.1.1/repository/cache/ch.qos.logback/logback-core/jars/logback-core-1.0.11.jar:/home/ec2-user/play-2.1.1/repository/cache/ch.qos.logback/logback-classic/jars/logback-classic-1.0.11.jar:/home/ec2-user/play-2.1.1/repository/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.7.4.jar:/home/ec2-user/play-2.1.1/repository/cache/org.scribe/scribe/jars/scribe-1.3.3.jar:/home/ec2-user/play-2.1.1/repository/local/commons-codec/commons-codec/1.4/jars/commons-codec.jar -encoding utf8 -deprecation -bootclasspath /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/resources.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/rt.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/jce.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/netx.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/plugin.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/rhino.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/jfr.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/classes:/home/ec2-user/play-2.1.1/framework/sbt/boot/scala-2.10.0/lib/scala-library.jar -unchecked -d /home/ec2-user/chat/target/scala-2.10/classes
[error]
[error] last tree to typer: Literal(Constant(String))
[error] symbol: null
[error] symbol definition: null
[error] tpe: Class(classOf[java.lang.String])
[error] symbol owners:
[error] context owners: anonymous class anonfun$routes$1 -> package <empty>
[error]
[error] == Enclosing template or block ==
[error]
[error] Template( // val <local $anonfun>: <notype>, tree.tpe=anonfun$routes$1
[error] "scala.runtime.AbstractPartialFunction", "scala.Serializable" // parents
[error] ValDef(
[error] private
[error] "_"
[error] <tpt>
[error] <empty>
[error] )
[error] // 5 statements
[error] DefDef( // final override def applyOrElse(x$1: play.api.mvc.RequestHeader,default: Function1): Object
[error] <method> final override <triedcooking>
[error] "applyOrElse"
[error] []
[error] // 1 parameter list
[error] ValDef( // x$1: play.api.mvc.RequestHeader
[error] <param> <synthetic> <triedcooking>
[error] "x$1"
[error] <tpt> // tree.tpe=play.api.mvc.RequestHeader
[error] <empty>
[error] )
...fifteen hundred lines more of such gibberish, and finally...
[error] )
[error] )
[error] DefDef( // def <init>(): anonfun$routes$1
[error] <method> <triedcooking>
[error] "<init>"
[error] []
[error] List(Nil)
[error] <tpt> // tree.tpe=anonfun$routes$1
[error] Block( // tree.tpe=Unit
[error] Apply( // def <init>(): scala.runtime.AbstractPartialFunction in class AbstractPartialFunction, tree.tpe=scala.runtime.AbstractPartialFunction
[error] Routes$$anonfun$routes$1.super."<init>" // def <init>(): scala.runtime.AbstractPartialFunction in class AbstractPartialFunction, tree.tpe=()scala.runtime.AbstractPartialFunction
[error] Nil
[error] )
[error] ()
[error] )
[error] )
[error] )
[error]
[error] == Expanded type of tree ==
[error]
[error] ConstantType(value = Constant(String))
[error]
[error] how can getCommonSuperclass() do its job if different class symbols get the same bytecode-level internal name: models/messages/package$Open
回答1:
The reason of such behaviour described a bit here.
In my case I've just move some classes from package object to normal object, and this is solved the problem. I think you should consider transformation of models/messages/package.scala
to normal object.
来源:https://stackoverflow.com/questions/16843769/getting-how-can-getcommonsuperclass-do-its-job-if-different-class-symbols-get