小编jnf*_*nfr的帖子

编译失败:在Scala 2.10下从Java 8加载AnnotatedElement,ConcurrentMap,CharSequence时出错?

我正在使用以下内容:

  • 斯卡拉2.10.4
  • Scalatra 2.2.2
  • sbt 0.13.0
  • java 1.8.0
  • casbah 2.7.2
  • scalatra-sbt 0.3.5

我经常遇到这个错误:

21:32:00.836 [qtp1687101938-55] ERROR o.fusesource.scalate.TemplateEngine - Compilation failed:
error: error while loading CharSequence, class file '/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
(class java.lang.RuntimeException/bad constant pool tag 18 at byte 10)
error: error while loading ConcurrentMap, class file '/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/rt.jar(java/util/concurrent/ConcurrentMap.class)' is broken
(class java.lang.RuntimeException/bad constant pool tag 18 at byte 61)
two errors found
21:38:03.616 [qtp1687101938-56] ERROR o.fusesource.scalate.TemplateEngine - Compilation failed:
error: error while loading AnnotatedElement, class file '/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/rt.jar(java/lang/reflect/AnnotatedElement.class)' is broken
(class java.lang.RuntimeException/bad …
Run Code Online (Sandbox Code Playgroud)

scala sbt

40
推荐指数
2
解决办法
3万
查看次数

返回Future.failed(Exception)和抛出异常之间的区别

在Scala中,返回Future.failed(new Exception("message!"))throw new Exception("message!")?之间的区别是什么?

假设这是在要返回的函数中发生的Future[Unit],并且调用函数是这样的:

someFunction onFailure {
  case ex: Exception => log("Some exception was thrown")
}
Run Code Online (Sandbox Code Playgroud)

是否有一个优先于另一个或每个特定用例?

scala

10
推荐指数
1
解决办法
6762
查看次数

在小牛升级后安装nokogiri - entities.c失踪了吗?

我遇到了大多数人在后Mavericks升级机上使用nokogiri安装时遇到的同样问题.

    /Users/lunchbag/.rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb --with-xml2-include=/usr/local/Cellar/libx/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin13.1.0/ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... ERROR, review 'tmp/x86_64-apple-darwin13.1.0/ports/libxml2/2.8.0/configure.log' to see what happened.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  Check the mkmf.log file for more details.  You may need configuration options.

Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/lunchbag/.rvm/rubies/ruby-2.0.0-p451/bin/ruby
/Users/lunchbag/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/mini_portile-0.5.3/lib/mini_portile.rb:278:in `block in execute': Failed to complete configure task (RuntimeError)
from …
Run Code Online (Sandbox Code Playgroud)

nokogiri osx-mavericks

0
推荐指数
1
解决办法
482
查看次数

标签 统计

scala ×2

nokogiri ×1

osx-mavericks ×1

sbt ×1