2016-04-16 15 views
0

何が起きているのか理解していないうちにこの問題が発生しています。IntelliJでsbtベースのプロジェクトをインポートし、IntelliJクラスパスにプロジェクトリソース(src/main/resources)がありません。その結果、nullを返すために.getClass.getResource(...)が呼び出されます。 enter image description hereIntelliJ IDEA/Scala:クラスパス上のコンフィグレーションミスリソースを実行する

私は.ideaを削除し、私は、以前のIntelliJのバージョンから既存の.ideaをアップグレードからのキャッシングの問題を疑ってるとして新たにプロジェクトを作成する傾向があります。しかし今日は運がない。時には.getResourceから.getResourceAsStreamに変更すると解決するようですが、今日はもう運がありません。プロジェクト設定の確認

、ディレクトリが正しく「資源」としてトグルする:

enter image description here

し、実行コンフィギュレーションを確認し、モジュール/クラスパスが正しく選択されています

enter image description here

言うまでもなく、端末からのsbt test:runを使用すると、期待どおりに動作し、リソースが見つかります。

/usr/lib/jvm/java-8-oracle/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:47427,suspend=y,server=n -Dfile.encoding=UTF-8 -classpath /usr/lib/jvm/java-8-oracle/jre/lib/charsets.jar:/usr/lib/jvm/java-8-oracle/jre/lib/deploy.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/cldrdata.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/dnsns.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/jaccess.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/jfxrt.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/nashorn.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunec.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/zipfs.jar:/usr/lib/jvm/java-8-oracle/jre/lib/javaws.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jce.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jfr.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jfxswt.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jsse.jar:/usr/lib/jvm/java-8-oracle/jre/lib/management-agent.jar:/usr/lib/jvm/java-8-oracle/jre/lib/plugin.jar:/usr/lib/jvm/java-8-oracle/jre/lib/resources.jar:/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar:/home/hhrutz/Documents/devel/Wolkenpumpe/target/scala-2.11/test-classes:/home/hhrutz/Documents/devel/Wolkenpumpe/target/scala-2.11/classes:/home/hhrutz/.ivy2/cache/com.github.scopt/scopt_2.11/jars/scopt_2.11-3.4.0.jar:/home/hhrutz/.ivy2/cache/org.slf4j/slf4j-simple/jars/slf4j-simple-1.7.18.jar:/home/hhrutz/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.7.18.jar:/home/hhrutz/.ivy2/cache/org.scalatest/scalatest_2.11/bundles/scalatest_2.11-2.2.6.jar:/home/hhrutz/.ivy2/cache/org.scala-stm/scala-stm_2.11/jars/scala-stm_2.11-0.7.jar:/home/hhrutz/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.5.jar:/home/hhrutz/.ivy2/cache/org.scala-lang.modules/scala-swing_2.11/bundles/scala-swing_2.11-1.0.2.jar:/home/hhrutz/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.7.jar:/home/hhrutz/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.8.jar:/home/hhrutz/.ivy2/cache/net.sourceforge.jtransforms/jtransforms/jars/jtransforms-2.4.0.jar:/home/hhrutz/.ivy2/cache/net.htmlparser.jericho/jericho-html/jars/jericho-html-3.3.jar:/home/hhrutz/.ivy2/cache/lucene/lucene/jars/lucene-1.4.3.jar:/home/hhrutz/.ivy2/cache/junit/junit/jars/junit-4.8.2.jar:/home/hhrutz/.ivy2/local/de.sciss/weblaf-ui/2.1.0/jars/weblaf-ui.jar:/home/hhrutz/.ivy2/local/de.sciss/weblaf-core/2.1.0/jars/weblaf-core.jar:/home/hhrutz/.ivy2/local/de.sciss/treetable-scala_2.11/1.3.8/jars/treetable-scala_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/treetable-java/1.3.8/jars/treetable-java.jar:/home/hhrutz/.ivy2/cache/de.sciss/topology_2.11/jars/topology_2.11-1.0.0.jar:/home/hhrutz/.ivy2/local/de.sciss/swingplus_2.11/0.2.1/jars/swingplus_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/submin/0.2.0/jars/submin.jar:/home/hhrutz/.ivy2/cache/de.sciss/span_2.11/jars/span_2.11-1.3.1.jar:/home/hhrutz/.ivy2/local/de.sciss/soundprocesses-views_2.11/3.4.0/jars/soundprocesses-views_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/soundprocesses-core_2.11/3.4.0/jars/soundprocesses-core_2.11.jar:/home/hhrutz/.ivy2/cache/de.sciss/serial_2.11/jars/serial_2.11-1.0.2.jar:/home/hhrutz/.ivy2/cache/de.sciss/scissdsp_2.11/jars/scissdsp_2.11-1.2.2.jar:/home/hhrutz/.ivy2/local/de.sciss/scalaosc_2.11/1.1.5/jars/scalaosc_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/scalacolliderugens-plugins_2.11/1.14.1/jars/scalacolliderugens-plugins_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/scalacolliderugens-core_2.11/1.14.1/jars/scalacolliderugens-core_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/scalacolliderugens-api_2.11/1.14.1/jars/scalacolliderugens-api_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/scalacolliderswing-core_2.11/1.28.0/jars/scalacolliderswing-core_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/scalacollider_2.11/1.18.1/jars/scalacollider_2.11.jar:/home/hhrutz/.ivy2/cache/de.sciss/scalaaudiofile_2.11/jars/scalaaudiofile_2.11-1.4.5.jar:/home/hhrutz/.ivy2/local/de.sciss/raphael-icons_2.11/1.0.3/jars/raphael-icons_2.11.jar:/home/hhrutz/.ivy2/cache/de.sciss/processor_2.11/jars/processor_2.11-0.4.0.jar:/home/hhrutz/.ivy2/local/de.sciss/prefuse-core/1.0.1/jars/prefuse-core.jar:/home/hhrutz/.ivy2/cache/de.sciss/numbers_2.11/jars/numbers_2.11-0.1.1.jar:/home/hhrutz/.ivy2/cache/de.sciss/model_2.11/jars/model_2.11-0.3.2.jar:/home/hhrutz/.ivy2/local/de.sciss/lucresynth_2.11/3.4.0/jars/lucresynth_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/lucreswing_2.11/1.3.0/jars/lucreswing_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/lucre-expr_2.11/3.3.1/jars/lucre-expr_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/lucre-core_2.11/3.3.1/jars/lucre-core_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/lucre-confluent_2.11/3.3.1/jars/lucre-confluent_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/lucre-bdb_2.11/3.3.1/jars/lucre-bdb_2.11.jar:/home/hhrutz/.ivy2/cache/de.sciss/intensitypalette/jars/intensitypalette-1.0.0.jar:/home/hhrutz/.ivy2/cache/de.sciss/fingertree_2.11/jars/fingertree_2.11-1.5.2.jar:/home/hhrutz/.ivy2/cache/de.sciss/fileutil_2.11/jars/fileutil_2.11-1.1.1.jar:/home/hhrutz/.ivy2/local/de.sciss/desktop_2.11/0.7.2/jars/desktop_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/audiowidgets-swing_2.11/1.9.4/jars/audiowidgets-swing_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/audiowidgets-core_2.11/1.9.4/jars/audiowidgets-core_2.11.jar:/home/hhrutz/.ivy2/local/de.sciss/audiowidgets-app_2.11/1.9.2/jars/audiowidgets-app_2.11.jar:/home/hhrutz/.ivy2/cache/com.thoughtworks.xstream/xstream/jars/xstream-1.4.8.jar:/home/hhrutz/.ivy2/cache/com.sleepycat/je/jars/je-5.0.104.jar:/home/hhrutz/.ivy2/cache/com.mortennobel/java-image-scaling/jars/java-image-scaling-0.8.6.jar:/home/hhrutz/.ivy2/cache/com.jhlabs/filters/jars/filters-2.0.235.jar:/home/hhrutz/Applications/idea-IC-16/lib/idea_rt.jar de.sciss.nuages.Demo 

答えて

1

実行構成を削除し、それが新たな問題を「固定」作成:

FWIFは、ここで私は全くクラスパス内のリソースを見つけることができませんIDEA、から実行呼び出しです。これはIntelliJのバグのようですが、おそらくキャッシングやインデックス作成に関連しています。

前の壊れたコールされました:

java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:47427,suspend=y,server=n \ 
    -classpath ... \ 
    de.sciss.nuages.Demo 

新しい正しいコールになった:クラスパスが同じである

java -Didea.launcher.port=7534 \ 
    -Didea.launcher.bin.path=/home/hhrutz/Applications/idea-IC-16/bin \ 
    -classpath ... \ 
    com.intellij.rt.execution.application.AppMain de.sciss.nuages.Demo 

のでながら、発射メカニズムは完全に異なっています。

関連する問題