ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Masanz, James J." <Masanz.Ja...@mayo.edu>
Subject RE: scala and groovy
Date Fri, 13 Dec 2013 19:00:47 GMT

Sort of good news on the scala front -- after I added the complete filename for the jars to
the rootLoader statements (I had left out the "version" part of the jar names),  using scala
now works.

jarName = "scala-library-2.9.0.jar";
this.class.classLoader.rootLoader.addURL( new URL(libLocation + jarName) );
jarName = "sbinary_2.9.0-0.4.0.jar";
this.class.classLoader.rootLoader.addURL( new URL(libLocation + jarName) );

(not ready to post a full solution yet - pipeline did not run to completion, but at least
I'm on to the next issue now)

-- James

-----Original Message-----
From: dev-return-2314-Masanz.James=mayo.edu@ctakes.apache.org [mailto:dev-return-2314-Masanz.James=mayo.edu@ctakes.apache.org]
On Behalf Of Masanz, James J.
Sent: Friday, December 13, 2013 10:59 AM
To: 'dev@ctakes.apache.org'
Subject: RE: scala and groovy

That would be great if you could try to replicate.
Check out  ctakes/sandbox/groovy/cTAKES-with-resources.groovy
Download the two zips from ctakes/sandbox/groovy-temp-resources/
Extract them so that the directory containing  cTAKES-with-resources.groovy also now contains
a desc subdirectory and an org subdirectory.
mkdir inputDir
groovy cTAKES-with-resources.groovy  inputDir

Thanks Pei!

-----Original Message-----
From: dev-return-2313-Masanz.James=mayo.edu@ctakes.apache.org [mailto:dev-return-2313-Masanz.James=mayo.edu@ctakes.apache.org]
On Behalf Of Chen, Pei
Sent: Friday, December 13, 2013 10:48 AM
To: dev@ctakes.apache.org
Subject: RE: scala and groovy

James,
Would it be possible to also attach your script?  I can try to replicate it here...
--Pei

> -----Original Message-----
> From: Masanz, James J. [mailto:Masanz.James@mayo.edu]
> Sent: Friday, December 13, 2013 11:34 AM
> To: 'dev@ctakes.apache.org'
> Subject: scala and groovy
> 
> 
> I'm still working on getting the clinical-pipeline
> (AggregatePlaintextUMLSProcessor) to run from groovy, using the
> parser.groovy as a starting point
> 
> A side issue to the main point of this post:
> The first  issue is already marked as a TODO in parser.groovy -- about
> downloading models. I am working around that for now by programmatically
> downloading all models needed and the LookupDesc_Db.xml from SVN in
> the same way parser.groovy downloads the sentence detector model,
> because things within the ctakes-*-res jars aren't being found by
> org.apache.ctakes.core.resource.FileLocator#getAsStream
> 
> Another issue is some of the jars that are used by the assertion component:
> med-facts-i2b2-1.2-SNAPSHOT.jar
> med-facts-zoner-1.1.jar
> jcarafe-ext_2.9.1-0.9.8.3.RC4.jar
> jcarafe-core_2.9.1-0.9.8.3.RC4.jar
> 
> I download those also separately from SVN and add them using statements
> like this:
> this.class.classLoader.rootLoader.addURL( new URL(libLocation + jarName) );
> 
> The bigger issue is the following
> I was getting an error about scala, so I added the following to the Grapes
> annotation in my groovy script @Grab(group='org.scala-lang', module='scala-
> library', version='2.9.0'), @Grab(group='org.scala-tools.sbinary',
> module='sbinary_2.9.0', version='0.4.0'),
> 
> Those grapes now appear in my grapes repo. But I am getting the following
> error, and I don't know why ScopeParser cannot "see" scala.ScalaObject
> which I believe is defined in one of the scala jars that I added to the
> rootLoader as I described above.
> 
> scope model: /C:/usr/meTAKES/using-
> groovy/org/apache/ctakes/assertion/models/scope.model
> Caught: java.lang.NoClassDefFoundError: scala/ScalaObject
> java.lang.NoClassDefFoundError: scala/ScalaObject
>         at
> org.mitre.medfacts.i2b2.annotation.ScopeParser.<init>(ScopeParser.java:22)
>         at
> org.apache.ctakes.assertion.medfacts.AssertionAnalysisEngine.initialize(Ass
> ertionAnalysisEngine.java:121)
>         at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize
> AnalysisComponent(PrimitiveAnalysisEngine_impl.java:250)
>         at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize
> (PrimitiveAnalysisEngine_impl.java:156)
>         at
> org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(Analysi
> sEngineFactory_impl.java:94)
>         at
> org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(C
> ompositeResourceFactory_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:25
> 4)
>         at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initAS
> B(AggregateAnalysisEngine_impl.java:431)
>         at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializ
> eAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:375)
>         at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializ
> e(AggregateAnalysisEngine_impl.java:185)
>         at
> org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(Analysi
> sEngineFactory_impl.java:94)
>         at
> org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(C
> ompositeResourceFactory_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:25
> 4)
>         at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initAS
> B(AggregateAnalysisEngine_impl.java:431)
>         at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializ
> eAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:375)
>         at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializ
> e(AggregateAnalysisEngine_impl.java:185)
>         at
> org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(Analysi
> sEngineFactory_impl.java:94)
>         at
> org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(C
> ompositeResourceFactory_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:25
> 4)
>         at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initAS
> B(AggregateAnalysisEngine_impl.java:431)
>         at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializ
> eAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:375)
>         at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializ
> e(AggregateAnalysisEngine_impl.java:185)
>         at
> org.uimafit.factory.AnalysisEngineFactory.createAggregate(AnalysisEngineFa
> ctory.java:505)
>         at
> org.uimafit.factory.AggregateBuilder.createAggregate(AggregateBuilder.java
> :200)
>         at org.uimafit.factory.AggregateBuilder$createAggregate.call(Unknown
> Source)
>         at cTAKES-with-resources.run(cTAKES-with-resources.groovy:365)
> Caused by: java.lang.ClassNotFoundException: scala.ScalaObject
>         ... 32 more

Mime
View raw message