Featured post
scala - AbstractMethodError when running standalone jar built with SBT and ProGuard -
i've written simple scala application i'd distribute in form of standalone, executable jar servers without scala runtime. works fine when invoked through sbt run
, not java -jar
.
when run jar through java, following unhandled exception:
exception in thread "main" java.lang.abstractmethoderror: java.util.logging.handler.publish(ljava/util/logging/logrecord;)v @ java.util.logging.logger.log(logger.java:458) @ net.lag.logging.logger.log(logger.scala:108) @ net.lag.logging.logger.log(logger.scala:91) @ net.lag.logging.logger.info(logger.scala:121) @ com.rentawebgeek.sitewiki.sitewiki$.main(sitewiki.scala:29) @ com.rentawebgeek.sitewiki.sitewiki.main(sitewiki.scala) exception in thread "thread-0" java.lang.abstractmethoderror: java.util.logging.handler.close()v @ java.util.logging.logmanager.resetlogger(logmanager.java:682) @ java.util.logging.logmanager.reset(logmanager.java:665) @ java.util.logging.logmanager$cleaner.run(logmanager.java:223)
i'm using configgy , it's logger, and, per javadocs abstractmethoderror, thought might related scala/sbt using different java version i'm invoking shell. however, java -version
, $java_home/bin/java -version
(what /usr/local/bin/scala
uses) both match 1.6.0_22.
my proguard options are:
//program entry point override def mainclass: option[string] = some("com.rentawebgeek.sitewiki.sitewiki") //proguard override def proguardoptions = list( "-keepclasseswithmembers public class * { public static void main(java.lang.string[]); }", "-dontoptimize", "-dontobfuscate", "-keep class *", proguardkeeplimitedserializability, proguardkeepallscala, "-keep interface scala.scalaobject" ) override def proguardinjars = path.fromfile(scalalibraryjar) +++ super.proguardinjars
how can resolve error? or find way build executable jar sbt project scala-less deployment?
check out call making @ line 29 in sitewiki.scala; offending call. you're calling trait/class there abstract method. method should implement abstract method ripped away proguard (or there scala override doesn't match (i've seen happen)).
if line long find offending call; try decompose on multiple lines.
- Get link
- X
- Other Apps
Comments
Post a Comment