uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Lally" <ala...@alum.rpi.edu>
Subject Re: Test case failing
Date Thu, 14 Aug 2008 13:57:24 GMT
On Wed, Aug 13, 2008 at 5:23 PM, Marshall Schor <msa@schor.com> wrote:
> Some analysis:
>
> The test constructs an aggregate descriptor, having a Pear Specifier as one
> of the delegates.
>
> ASB_impl iterates through all of the aggregates delegates, (as part of the
> produceResource method) and calls produceAnalysisEngine on each delegate.
>
> This goes thru the CompositeResourceFactory_impl, which looks at its list of
> produceResource impls for one that matches, and ends up dispatching to
> SimpleResourceFactory.produceResource, for the PearSpecifier_impl.
>
> This (correctly) instantiates a PearAnalysisEngineWrapper class instance for
> this.
>
> The initialize method of the wrapper calls getResourceManager() which
> returns null (line 176).
>

Well, that code seems wrong to me.  It looks like
this.getResourceManager() will always return null.
PearAnalysisEngineWrapper.initialize never calls super.initialize
(perhaps there is some reason why not, I don't know), and I think that
calling super.initialize would be necessary to allow
this.getResourceManager() to work.

> It creates an innerRM - the resource manager it will use, from the pear's
> classpath and datapath, on line 184.
>
> It then calls produceAnalysisEngine, passing in both the innerRM which does
> have the class loader set to the right place (a temp dir where the class
> file is), plus additionalParams, which *also* has a resource manager (the
> containing aggregate's ).
>

This is the problem.  It doesn't work to just pass the
aAdditionalParms map to the wrapped analysis engine (which was
introduced in UIMA-1107 without appropriate testing).  The way the
PEAR Wrapper was originally designed, the wrapped AE is supposed to be
completely insulated from the aggregate that contains it, but this is
now broken.

All AEs within a single (possibly nested) aggregate share the same
RootUimaContext, and it's at the RootUimaContext where the
ResourceManager is attached.  So all AEs in a single aggregate must
share the same ResourceManager.  Since we don't want that behavior,
the PEAR Wrapper cannot share the same RootUimaContext.  But when you
pass along aAdditionalParams, that's exactly what happens - one of the
things in aAdditionalParams is the parent UimaContext to use.

To fix UIMA-1107, which is about passing the Sofa mappings through,
the wrapper should extract the Sofa mappings from the parent's
aAdditionalParms and pass just those along to the wrapped AE.

  -Adam

Mime
View raw message