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:32:17 GMT
I wonder too. That's why I said "Sort of good news".
I assume it's because I am loading med-facts jars myself since their dependencies don't seem
to have been resolved in maven central yet, at least I could not get them to work that way.
And I see CTAKES-76 is still open

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

James,
I wonder why the transitive dependencies didn't resolve that automatically (I think scala
is in maven central) just like the other jars...
i.e. why do we need to have it manually added to the classpath?

> -----Original Message-----
> From: Masanz, James J. [mailto:Masanz.James@mayo.edu]
> Sent: Friday, December 13, 2013 2:02 PM
> To: 'dev@ctakes.apache.org'
> Subject: RE: scala and groovy
> 
> 
> 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.initializ
> > e(Ass
> > ertionAnalysisEngine.java:121)
> >         at
> > org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.init
> > ialize
> > AnalysisComponent(PrimitiveAnalysisEngine_impl.java:250)
> >         at
> > org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.init
> > ialize
> > (PrimitiveAnalysisEngine_impl.java:156)
> >         at
> >
> org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(Analys
> > i
> > 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.init
> > AS
> > B(AggregateAnalysisEngine_impl.java:431)
> >         at
> > org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.init
> > ializ
> > eAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:375)
> >         at
> > org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.init
> > ializ
> > e(AggregateAnalysisEngine_impl.java:185)
> >         at
> >
> org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(Analys
> > i
> > 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.init
> > AS
> > B(AggregateAnalysisEngine_impl.java:431)
> >         at
> > org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.init
> > ializ
> > eAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:375)
> >         at
> > org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.init
> > ializ
> > e(AggregateAnalysisEngine_impl.java:185)
> >         at
> >
> org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(Analys
> > i
> > 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.init
> > AS
> > B(AggregateAnalysisEngine_impl.java:431)
> >         at
> > org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.init
> > ializ
> > eAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:375)
> >         at
> > org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.init
> > ializ
> > e(AggregateAnalysisEngine_impl.java:185)
> >         at
> > org.uimafit.factory.AnalysisEngineFactory.createAggregate(AnalysisEngi
> > neFa
> > 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