Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I'm working with ConceptMapper, which means I need to attach a FileResourceSpecifier to the external dictionary resource (it only took me most of the day to work this out).
The relevant bits of code are something like this:
AnalysisEngineDescription aed = AnalysisEngineFactory.createAnalysisEngineDescription(
"analysis_engine.descriptor_name");
ExternalResourceDescription dictRes =
ExternalResourceFactory.createExternalResourceDescription(
"DictionaryFileName", DictionaryResource_impl.class, "someURL");
FileResourceSpecifier frSpec = new FileResourceSpecifier_impl();
frSpec.setFileUrl("file:testDict.xml");
dictRes.setResourceSpecifier(frSpec);
ExternalResourceFactory.bindExternalResource(aed,
ConceptMapper.PARAM_DICT_FILE, dictRes)
This gets an IllegalClassException:
org.apache.commons.lang.IllegalClassException: Unsupported resource specifier class [class org.apache.uima.resource.impl.FileResourceSpecifier_impl]
at org.uimafit.factory.ConfigurationParameterFactory.canParameterBeSet(ConfigurationParameterFactory.java:584)
at org.uimafit.factory.ExternalResourceFactory.bindNestedResources(ExternalResourceFactory.java:839)
I think this is a spurious error; I've wrapper the call to .canParameterBeSet() in a try/catch, and it seems to work fine (I've now got another unrelated downstream problem, so I can't promise yet, but will update when I do know more)
See also: https://code.google.com/p/uimafit/issues/detail?id=133