Uploaded image for project: 'ManifoldCF'
  1. ManifoldCF
  2. CONNECTORS-1725

MissingResourceException exception occurs at Generic Repository Connector

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • ManifoldCF 2.24
    • None
    • None

    Description

      Hi there,

      As there is a problem that is still not addressed during use, I would like to suggest the following correction for the source code of the Generic Repository Connector.
      For additional details, please see below:

      1. Connector name

      Generic Repository Connector

      2. Issue

      When I create or edit a job using Generic Repository Connector, if I add a parameter without designate its Parameter name field, the alert message generic.TypeInParamName appears.

      An error log is as follows:

      ERROR 2022-08-04T15:45:43,443 (qtp10405169-442) - Missing resource 'generic.TypeInParamName' in bundle 'org.apache.manifoldcf.crawler.connectors.generic.common' for locale 'en'
      java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key generic.TypeInParamName
          at java.util.ResourceBundle.getObject(ResourceBundle.java:450) ~[?:1.8.0_211]
          at java.util.ResourceBundle.getString(ResourceBundle.java:407) ~[?:1.8.0_211]
          at org.apache.manifoldcf.core.i18n.Messages.getMessage(Messages.java:195) ~[mcf-core.jar:?]
          at org.apache.manifoldcf.core.i18n.Messages.getMessage(Messages.java:184) ~[mcf-core.jar:?]
          at org.apache.manifoldcf.core.i18n.Messages.getString(Messages.java:218) ~[mcf-core.jar:?]
          at org.apache.manifoldcf.ui.i18n.Messages.getBodyJavascriptString(Messages.java:343) ~[mcf-ui-core.jar:?]
          at org.apache.manifoldcf.crawler.connectors.generic.Messages.getBodyJavascriptString(Messages.java:95) ~[?:?]
          at org.apache.manifoldcf.crawler.connectors.generic.Messages.getBodyJavascriptString(Messages.java:54) ~[?:?]
          at org.apache.manifoldcf.crawler.connectors.generic.GenericConnector.outputSpecificationHeader(GenericConnector.java:610) ~[?:?]
      

      3. Reproduction

      • Create a Generic Repository Connector
      • Create a job using the connector created above with the following details:
        • On the Parameters tab, add the following parameters:
          • Parameter name: blank
          • Parameter value: <optional>
          • Click [Add]

      4. Cause

      Key generic.TypeInParamName is not present in native2ascii *.properties files, however it is in use.
      Perhaps, this key is being mistaken with generic.TypeInParameterName, that is not in use.

      5. Solution

      Update the property key used in java classes so that it matches the one defined in *.properties files:
      generic.TypeInParamNamegeneric.TypeInParameterName

      6. Suggested source code (based on release 2.22.1)

      https://github.com/apache/manifoldcf/blob/release-2.22.1/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java#L610

            + "function "+seqPrefix+"SpecAddParam(anchorvalue) {\n"
            + "  if (editjob."+seqPrefix+"specparamname.value == \"\")\n"
            + "  {\n"
      -     + "    alert(\"" + Messages.getBodyJavascriptString(locale, "generic.TypeInParamName") + "\");\n"
      +     + "    alert(\"" + Messages.getBodyJavascriptString(locale, "generic.TypeInParameterName") + "\");\n"
            + "    editjob."+seqPrefix+"specparamname.focus();\n"
            + "    return;\n"
            + "  }\n"
            + "  "+seqPrefix+"SpecOp(\""+seqPrefix+"paramop\",\"Add\",anchorvalue);\n"
            + "}\n"
      

      Attachments

        Activity

          People

            kwright@metacarta.com Karl Wright
            NhatNH Nguyen Huu Nhat
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: