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: Injecting nested resources using UIMA fit
Date Sat, 23 May 2015 20:21:55 GMT
Ok, so here is the analysis. There are two independent reasons why the code does
not work.

== Unexpected used of "bindExternalResource" ==

I did not foresee using "bindExternalResource" for binding
a nested resource to a resource. So instead of

resourceA = createExternalResourceDescription(ResourceA.class,"http://resource.org/a");
resourceB = createExternalResourceDescription(ResourceB.class,"http://resource.org/b");
bindExternalResource(resourceB, ResourceA.RESOURCE_A_KEY, resourceA);

You need to write:

resourceA = createExternalResourceDescription(ResourceA.class,"http://resource.org/a");
resourceB = createExternalResourceDescription(ResourceB.class,"http://resource.org/b",
  ResourceA.RESOURCE_A_KEY, resourceA);

The reason here is that part of the magic that makes nesting work happens in 
createExternalResourceDescription and is missed if bindExternalResource is used.

Still, bindExternalResource shouldn't fail with an NPE here - it should give a reasonable
message. And it should behave consistently, so produce the same error no matter when it
is called in the code - or it should just work as expected...

== createExternalResourceDescription for SharedResourceObjects missing code ==

The proper code for handling nested resources is missing from the createExternalResourceDescription
variant used to with SharedResourceObjects. This is an oversight and will be fixed. I've done
local fix and will commit that soon.

Btw. any reason you are still on UIMA 2.6.0? I am considering to do the next uimaFIT release
based on 2.7.0 (and Java 1.6).

-- Richard
View raw message