NCBI-Hackathons / seqr

Creative Commons Zero v1.0 Universal
12 stars 2 forks source link

Can't run from commandline #24

Closed averagehat closed 9 years ago

averagehat commented 9 years ago

Tests pass--which include running Seqr.main() without error--but I get an exception if I try running directly from the commandline. This suggests to me that there is a problem with the pom file. I tried removing <scope> test </scope> here but that did not help.

averagehat commented 9 years ago

Forgot to include the error output:

bash-4.1$ java -jar   target/seqr-4.10.4-SNAPSHOT-jar-with-dependencies.jar   search testdata/data/test.fasta --db testdata/solr/
log4j:WARN No appenders could be found for logger (org.apache.solr.core.SolrResourceLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.util.ServiceConfigurationError: Cannot instantiate SPI class: org.apache.lucene.codecs.asserting.AssertingCodec
    at org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:77)
    at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:47)
    at org.apache.lucene.util.NamedSPILoader.<init>(NamedSPILoader.java:37)
    at org.apache.lucene.codecs.Codec.<clinit>(Codec.java:41)
    at org.apache.solr.core.SolrResourceLoader.reloadLuceneSPI(SolrResourceLoader.java:206)
    at org.apache.solr.core.SolrResourceLoader.<init>(SolrResourceLoader.java:142)
    at org.apache.solr.core.SolrResourceLoader.<init>(SolrResourceLoader.java:256)
    at org.apache.solr.core.CoreContainer.<init>(CoreContainer.java:134)
    at gov.nih.nlm.ncbi.seqr.Seqr.handleCommand(Seqr.java:204)
    at gov.nih.nlm.ncbi.seqr.Seqr.main(Seqr.java:67)
Caused by: java.lang.IllegalArgumentException: An SPI class of type org.apache.lucene.codecs.PostingsFormat with name 'Lucene41' does not exist.  You need to add the corresponding JAR file supporting this SPI to your classpath.  The current classpath supports the following names: [MockFixedIntBlock, MockVariableIntBlock, MockRandom, MockSep, NestedPulsing, RAMOnly, Lucene41WithOrds, TestBloomFilteredLucene41Postings, Asserting, Lucene40]
    at org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:109)
    at org.apache.lucene.codecs.PostingsFormat.forName(PostingsFormat.java:100)
    at org.apache.lucene.codecs.lucene410.Lucene410Codec.<init>(Lucene410Codec.java:131)
    at org.apache.lucene.codecs.asserting.AssertingCodec.<init>(AssertingCodec.java:40)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at java.lang.Class.newInstance(Class.java:442)
    at org.apache.lucene.util.NamedSPILoader.reload(NamedSPILoader.java:67)
    ... 9 more
lianyi commented 9 years ago

Hi, @averagehat

We notice that too (Bo) yesterday. it looks like the maven assembly you recently added may need some tweak.

For now, the following command works for me.

mvn exec:java -Dexec.mainClass="gov.nih.nlm.ncbi.seqr.Seqr" -Dexec.args="search testdata/data/test.fasta --db testdata/solr/"

Also we may need to increase the heap size for JVM to a minimum 1G for unit testing (I noticed that's requirement in my 5 years old macbook pro), if maven test take very long time.

averagehat commented 9 years ago

I'm not sure if this was a new issue or not--I'm not sure if running the full command was ever working on my end--just the tests were working.

The problem is explained here I was able to fix this using the shade plugin

I will add a test to cover this to .travis.yml and close this once that is set up and working. But PR #25 fixes the issue for me.

lianyi commented 9 years ago

25 works for me too, I have merged the pull request, but It somehow automatically closed this issue, if you still need this ticket to open for .travis.yml , please feel free.