uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Eckart de Castilho <...@apache.org>
Subject Re: spring (boot) autowiring into custom AnalysisEngines via uimafit
Date Fri, 12 Feb 2016 10:49:57 GMT
Hi,

just a few quick answers for the moment (I didn't yet look into the code)...

> On 12.02.2016, at 07:20, Hendrik Lücke-Tieke <helt@outlook.com> wrote:
> 
> Hi,
> 
> i am digging a bit into autowiring singleton beans into analysis engines. In
> comparison to the efforts in the uima-spring project, I am now able 
> 
> -          to autowire anything that is known in the application context
> 
> -          run SimplePipeline.runPipeline under certain conditions
> (uima-spring merely instantiated analysis-engines, while collectionreader is
> working for me now, too)
> 
> You can see the current state in
> https://github.com/helt/uimafit-spring-experiments .
> 
> 
> 
> The problem is the following: In the AE instances of
> MyAutowiredAnalysisEngine, the 
> 
> @Autowired ExampleService is being injected (by spring), but the

Ok if this works thats good (using the prototypical uimafit-spring integration).

> @ConfigurationParameter ARBITRARY_BUT_CERTAINLY_NOT_OVERLOADED_NAME is not.

Configuration parameters were not meant to be set by spring. These must be set via createEngineDescription()
or createEngine().

The idea of uimafit-spring was to provide access to the spring context as an additional way
to access resources - an alternative to the "external resources" mechanism in UIMA that isn't
always suitable. 

> This is kinda awkward, and hopefully this is fixable. And I am thankful for
> every hint.
> 
> The parameters are being picked up by uimafit as the should. (The
> AE-Description does contain the correct parameters in its metadata) but when
> it comes to instantiation, they go lost. I suspect UIMAFramework : lines 318
> -> 331 -> 279 to be somehow guilty, but tbh, I don’t have enough knowledge
> how uima interally works. I currently assume that the wrong
> UIMAFramework_impl is being used. Can anyone confirm this?

What components are you using? If you wrote your own components, make sure you are deriving
from the base-classes in uimaFIT, not the ones in UIMA (same names, different packages). Also
make sure to call super.initialize(...) if you override the initialize method, otherwise uimaFIT
is unable to inject the parameters into the annotated fields.

Cheers,

-- Richard
Mime
View raw message