Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-3093

Specifying other classes, such as FileResourceSpecifier_impl, as resource specifiers causes IllegalClassException when binding

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0uimaFIT
    • Component/s: uimaFIT
    • Labels:
      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

        Attachments

          Activity

            People

            • Assignee:
              rec Richard Eckart de Castilho
              Reporter:
              rec Richard Eckart de Castilho
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: