Uploaded image for project: 'cTAKES'
  1. cTAKES
  2. CTAKES-504

Add visibility into implicitly expected resource paths in ctakes-core FileLocator.class

    XMLWordPrintableJSON

    Details

      Description

      In /trunk/ctakes-core/src/main/java/org/apache/ctakes/core/resource/FileLocator.java, the method getFileSearchPaths makes certain implicit assumptions about where to look for resources if environment variable CTAKES_HOME is not set. This can cause confusion about where resources should be placed in projects attempting to use ctakes library jars, since if they are not in these expected locations, the current errors may look like

      Exception in thread "main" 06 Apr 2018 00:17:53 ERROR JdbcRareWordDictionary - Could not Connect to Dictionary sno_rx_16abTerms
      org.apache.uima.resource.ResourceInitializationException: Initialization of annotator class "org.apache.ctakes.dictionary.lookup2.ae.DefaultJCasTermAnnotator" failed. (Descriptor: <unknown>)

      Which does not inform that the problem is related to where the resources/ folder has been placed.

      I propose adding an additional small bit of output text before the method returns, of the form:

      LOGGER.info( String.format("Obtained search paths for resource %s:", location) );
      for (String path : paths) {
        LOGGER.info(path);
      }

      This way if the code is ever changed, this snippet will be seen by the changee, rather than relying on separate documentation keeping in sync with any changes in the future.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              reedv Reed Villanueva
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified