ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abramowitsch, Peter" <pabramowit...@hearst.com>
Subject Re: running pipeline from command line
Date Tue, 28 Jun 2016 18:32:12 GMT
Hi Dima

Personally I hate Maven because of how it obscures classpaths and
dependencies (even though it purports to make that easier).   My use case
is a little different than yours, but when I launch a little pipeline from
the command line, it looks as simple as this:

Cd into the top of my application directory
export MSPK=$PWD

/usr/bin/java -cp 
"${MSPK}/classes":"${MSPK}/desc/":"${MSPK}/resources/":"${MSPK}/lib/*"
-Dlog4j.configuration=file:${MSPK}/config/log4j.xml
-Dctakes.umlsuser=xxxxx  -Dctakes.umlspw=xxxx  -Xms512M -Xmx3g
com.hbm.Main


** Desc being a tree where I have recursively copied all the descs from
individual ctakes packages
** Resources being a tree where I have recursively copied all the resource
from individual ctakes packages
** Lib contaning the complete set of Ctakes jars plus their supporting
jars.

My main starts up a REST server that loads a pipeline and connects
external requests to it.


Hope this helps
Peter



On 6/28/16, 11:22 AM, "Dligach, Dmitriy" <ddligach@luc.edu> wrote:

>Dear cTAKES developers,
>
>
>
>I ran into new issues running a uimafit pipeline from command line. I am
>trying to get a basic pipeline to run using this command:
>
>
>
>mvn exec:java 
>-Dexec.mainClass=³org.apache.ctakes.examples.pipelines.BasicAnnotations"
>
>
>
>It runs fine in Eclipse, but it stumbles on dictionary lookup when I run
>from command line. The dictionary lookup is added as follows:
>
>
>
>aggregateBuilder.add(
>DefaultJCasTermAnnotator.createAnnotatorDescription() )
>
>
>
>The full error message is below, but basically it is unable to find
>org/apache/ctakes/dictionary/lookup/fast/cTakesHsql.xml.
>
>
>
>Which does exist on my system in two places:
>
>
>
>./ctakes-dictionary-lookup-fast-res/src/main/resources/org/apache/ctakes/d
>ictionary/lookup/fast/cTakesHsql.xml
>
>./ctakes-dictionary-lookup-fast-res/target/classes/org/apache/ctakes/dicti
>onary/lookup/fast/cTakesHsql.xml
>
>
>
>I noticed that when I execute the mvn exec:java command, maven downloads
>the jars into my maven repository. Not sure why it¹s doing that ‹
>shouldn¹t it be able to run everything from the project directories?
>
>
>
>Any thoughts will be greatly appreciated.
>
>
>
>Dima
>
>
>
>28 Jun 2016 12:28:29  INFO AbstractJCasTermAnnotator - Using Dictionary
>Descriptor: org/apache/ctakes/dictionary/lookup/fast/cTakesHsql.xml
>
>[WARNING] 
>
>java.lang.reflect.InvocationTargetException
>
>	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>	at 
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
>62)
>
>	at 
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
>pl.java:43)
>
>	at java.lang.reflect.Method.invoke(Method.java:497)
>
>	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:294)
>
>	at java.lang.Thread.run(Thread.java:745)
>
>Caused by: org.apache.uima.resource.ResourceInitializationException:
>Initialization of annotator class
>"org.apache.ctakes.dictionary.lookup2.ae.DefaultJCasTermAnnotator"
>failed.  (Descriptor: <unknown>)
>
>	at 
>org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initiali
>zeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:252)
>
>	at 
>org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initiali
>ze(PrimitiveAnalysisEngine_impl.java:156)
>
>	at 
>org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEn
>gineFactory_impl.java:94)
>
>	at 
>org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(Composi
>teResourceFactory_impl.java:62)
>
>	at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:269)
>
>	at 
>org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:387
>)
>
>	at 
>org.apache.uima.analysis_engine.asb.impl.ASB_impl.setup(ASB_impl.java:254)
>
>	at 
>org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initASB(
>AggregateAnalysisEngine_impl.java:431)
>
>	at 
>org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initiali
>zeAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:375)
>
>	at 
>org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initiali
>ze(AggregateAnalysisEngine_impl.java:185)
>
>	at 
>org.apache.uima.fit.factory.AnalysisEngineFactory.createEngine(AnalysisEng
>ineFactory.java:711)
>
>	at 
>org.apache.uima.fit.factory.AggregateBuilder.createAggregate(AggregateBuil
>der.java:207)
>
>	at 
>org.apache.ctakes.examples.pipelines.BasicAnnotations.main(BasicAnnotation
>s.java:69)
>
>	... 6 more
>
>Caused by: org.apache.uima.resource.ResourceInitializationException
>
>	at 
>org.apache.ctakes.dictionary.lookup2.ae.AbstractJCasTermAnnotator.initiali
>ze(AbstractJCasTermAnnotator.java:117)
>
>	at 
>org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initiali
>zeAnalysisComponent(PrimitiveAnalysisEngine_impl.java:250)
>
>	... 18 more
>
>Caused by: java.io.FileNotFoundException:
>org/apache/ctakes/dictionary/lookup/fast/cTakesHsql.xml (No such file or
>directory)
>
>	at java.io.FileInputStream.open0(Native Method)
>
>	at java.io.FileInputStream.open(FileInputStream.java:195)
>
>	at java.io.FileInputStream.<init>(FileInputStream.java:138)
>
>	at 
>org.apache.ctakes.core.resource.FileLocator.getAsStream(FileLocator.java:6
>1)
>
>	at 
>org.apache.ctakes.dictionary.lookup2.ae.AbstractJCasTermAnnotator.initiali
>ze(AbstractJCasTermAnnotator.java:114)
>
>	... 19 more
>
>[INFO] 
>------------------------------------------------------------------------
>
>[INFO] BUILD FAILURE
>
>[INFO] 
>------------------------------------------------------------------------
>
>[INFO] Total time: 09:17 min
>
>[INFO] Finished at: 2016-06-28T12:28:29-05:00
>
>[INFO] Final Memory: 104M/188M
>
>[INFO] 
>------------------------------------------------------------------------
>
>[ERROR] Failed to execute goal
>org.codehaus.mojo:exec-maven-plugin:1.5.0:java (default-cli) on project
>ctakes-examples: An exception occured while executing the Java class.
>null: InvocationTargetException: Initialization of annotator class
>"org.apache.ctakes.dictionary.lookup2.ae.DefaultJCasTermAnnotator"
>failed.  (Descriptor: <unknown>): ResourceInitializationException:
>org/apache/ctakes/dictionary/lookup/fast/cTakesHsql.xml (No such file or
>directory) -> [Help 1]
>
>[ERROR] 
>
>[ERROR] To see the full stack trace of the errors, re-run Maven with the
>-e switch.
>
>[ERROR] Re-run Maven using the -X switch to enable full debug logging.
>
>[ERROR] 
>
>[ERROR] For more information about the errors and possible solutions,
>please read the following articles:
>
>[ERROR] [Help 1] 
>https://urldefense.proofpoint.com/v2/url?u=http-3A__cwiki.apache.org_confl
>uence_display_MAVEN_MojoExecutionException&d=CwIGaQ&c=B73tqXN8Ec0ocRmZHMCn
>tw&r=5LM1YwNyMUq7CWiSepCCsjTjwuVF4uswNF8BK5Orm10&m=ixrQpER8b5VvscuhN0yquuo
>ogfKG8tgJlDNU03kOwA4&s=VLcUCqZV24XNMC6542XwuaGC8QXo-_x0nI1edoVpUvc&e=
>
>
>
>Dima
>
>
>


Mime
View raw message