uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marshall Schor <...@schor.com>
Subject Re: Test case failing
Date Wed, 13 Aug 2008 21:23:17 GMT
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 

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 

This (correctly) instantiates a PearAnalysisEngineWrapper class instance 
for this.

The initialize method of the wrapper calls getResourceManager() which 
returns null (line 176).

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 ).

UIMAFramework.produceResource overrides (correctly) the one in the 
additional params with the passed in one.

Now the AnalysisEngineFactory_impl  produceResource is called, to 
instantiate the AE inside the pear.

PrimitiveAnalysEngine_impl initialize is called.  on line 198 it gets 
the *wrong* resource manager to try and load the class from.

It gets it using getUimaContextAdmin().getResourceManager().  It needs 
to get the resource manager passed in via the additional params.  Not 
sure if that was supposed to be set somehow into the current 
UimaContextAdmin or if this code is getting it from the wrong place.

So, it is a bug, need a Jira :-)


Michael Baessler wrote:
> Thilo Goetz wrote:
>> I updated from trunk just now and got the following test
>> case failures in core:
>> Tests in error:
>>   testPearRuntime(org.apache.uima.pear.util.PearRuntimeTest)
>>   testPearRuntimeDocAnnot(org.apache.uima.pear.util.PearRuntimeTest)
>> So I did a clean extract of trunk, and built with Maven on
>> the command line.  Same error.  Before I open an issue, can
>> anybody confirm this, or is it just me?  Seems odd that
>> nobody has noticed this before...
>> --Thilo
> It seems that the tests failed since we changed
>   this.ae = UIMAFramework.produceAnalysisEngine(specifier, innerRM, null);
> to
>   this.ae = UIMAFramework.produceAnalysisEngine(specifier, innerRM, aAdditionalParams);
> with issue UIMA-1107 (https://issues.apache.org/jira/browse/UIMA-1107)
> the aAdditionalParams Map parameter looks like:
>   {
>    UIMA_CONTEXT=org.apache.uima.impl.ChildUimaContext_impl@70bc70bc,
>    CONFIG_PARAM_SETTINGS=org.apache.uima.resource.metadata.impl.ConfigurationParameterSettings_impl:
>    parameterSettings = Array{}
>    settingsForGroups = {},
>    RESOURCE_MANAGER=org.apache.uima.resource.impl.ResourceManager_impl@f280f28,
>   }
> but when I check the ResourceManager in the debugger it seems to be different.
>    innerRM is org.apache.uima.resource.impl.ResourceManager_impl@1b541b54
> so sure what happens here...
> Eddie, can you help?
> -- Michael

View raw message