sbt assemblyは成功するのに実行するとExceptionInInitializerErrorが出る
SpamFilterプロジェクト( https://github.com/lamrongol/JapaneseTwitterSpamFilter/blob/master/src/main/scala/lamrongol/twitter/spamfilter/SimpleSpamFilter.scala )でsbt assembly
を実行すると成功しjarファイルができるのですが、それを以下のようなコマンドで実行すると、
java -cp .\SpamFilter-assembly-1.0.jar lamrongol.twitter.spamfilter.SimpleSpamFilter
以下のようなエラーが出て正常に動作しません。
Exception in thread "main" java.lang.ExceptionInInitializerError
at lamrongol.twitter.spamfilter.SimpleSpamFilter.main(SimpleSpamFilter.scala)
Caused by: java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.readLine(BufferedReader.java:324)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at scala.io.BufferedSource$BufferedLineIterator.hasNext(BufferedSource.scala:72)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:413)
at scala.collection.Iterator$class.foreach(Iterator.scala:742)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1194)
at lamrongol.twitter.spamfilter.SimpleSpamFilter$.loadResource(SimpleSpamFilter.scala:64)
at lamrongol.twitter.spamfilter.SimpleSpamFilter$.<init>(SimpleSpamFilter.scala:16)
at lamrongol.twitter.spamfilter.SimpleSpamFilter$.<clinit>(SimpleSpamFilter.scala)
... 1 more