Uploaded image for project: 'OpenNLP'
  1. OpenNLP
  2. OPENNLP-533

TypeSystem uses UIMA-reserved keyword blocking JCasGen from generating needed classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • tools-1.5.3
    • 1.6.0
    • UIMA Integration
    • None

    Description

      OpenNLP 1.5.3's UIMA TypeSystem uses the reserved keyword "type" for one of the features of it's Parse type:
      https://svn.apache.org/repos/asf/opennlp/trunk/opennlp-uima/descriptors/TypeSystem.xml
      "...
      <name>Apache OpenNLP TypeSystem</name>
      ...
      <types>
      ...
      <typeDescription>
      <name>opennlp.uima.Parse</name>
      <supertypeName>uima.tcas.Annotation</supertypeName>
      <features>
      <featureDescription>
      <name>type</name>
      ..."

      This makes it incompatible with UIMA 2.4.0's JCasGen for generating necessary Java classes from a TypeSystem at runtime:
      http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/Jg.java?revision=1338200&view=markup
      Line 105: "reservedFeatureNames.add("Type");"

      This results in the below exception in projects that need to use OpenNLP's UIMA Integration with JCasGen.

      One simple fix to this would be to change "type" to "parseType" (as per the "chunkType" feature of the Chunk type). I have attached a Patch that implements this fix.

      Thanks,
      Fergal.

      =====
      [INFO] Scanning for projects...
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Example Annotator 0.0.1
      [INFO] ------------------------------------------------------------------------
      ...
      [INFO]
      [INFO] >>> exec-maven-plugin:1.2.1.jbossorg-3:java (jcasgen) @ ExampleAnnotator >>>
      [INFO]
      [INFO] <<< exec-maven-plugin:1.2.1.jbossorg-3:java (jcasgen) @ ExampleAnnotator <<<
      [INFO]
      [INFO] — exec-maven-plugin:1.2.1.jbossorg-3:java (jcasgen) @ ExampleAnnotator —
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Sentence'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Sentence_Type'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Token'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Token_Type'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Chunk'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Chunk_Type'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Person'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Person_Type'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Organization'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Organization_Type'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Location'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Location_Type'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Date'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Date_Type'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Time'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Time_Type'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Money'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Money_Type'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Percentage'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.UimaLoggerProgressMonitor subTask(35)
      INFO: >>JCasGen Replacing: 'opennlp.uima.Percentage_Type'.
      14-Aug-2012 17:57:01 org.apache.uima.tools.jcasgen.LogThrowErrorImpl newError(37)
      SEVERE: JCasGen: The feature name 'type', specified in Type 'opennlp.uima.Parse' is reserved. Please choose another name.
      [WARNING]
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: org.apache.uima.tools.jcasgen.Jg$ErrorExit
      at org.apache.uima.tools.jcasgen.LogThrowErrorImpl.newError(LogThrowErrorImpl.java:39)
      at org.apache.uima.tools.jcasgen.JCasTypeTemplate.generate(JCasTypeTemplate.java:90)
      at org.apache.uima.tools.jcasgen.Jg.generateClassesFromTemplate(Jg.java:665)
      at org.apache.uima.tools.jcasgen.Jg.generateAllTypesFromTemplates(Jg.java:605)
      at org.apache.uima.tools.jcasgen.Jg.mainGenerateAllTypesFromTemplates(Jg.java:370)
      at org.apache.uima.tools.jcasgen.Jg.mainForCde(Jg.java:347)
      at org.uimafit.util.JCasGenPomFriendly.generate(JCasGenPomFriendly.java:89)
      at org.uimafit.util.JCasGenPomFriendly.main(JCasGenPomFriendly.java:76)
      ... 6 more
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 12.864s
      [INFO] Finished at: Tue Aug 14 17:57:01 BST 2012
      [INFO] Final Memory: 10M/107M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1.jbossorg-3:java (jcasgen) on project ExampleAnnotator: An exception occurred while executing the Java class. null: InvocationTargetException: ErrorExit -> [Help 1]
      [ERROR]
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

      Attachments

        1. OpenNLP-Parser-UIMA-TypeSystem.patch
          1.0 kB
          Fergal Monaghan

        Activity

          People

            joern Jörn Kottmann
            roadrunner Fergal Monaghan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: