You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Marshall Schor (JIRA)" <de...@uima.apache.org> on 2013/07/01 22:20:21 UTC

[jira] [Reopened] (UIMA-1793) jcasgen: load the descriptor from the classpath

     [ https://issues.apache.org/jira/browse/UIMA-1793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marshall Schor reopened UIMA-1793:
----------------------------------

      Assignee: Marshall Schor

looks like the error handling for file-not-found for the case of opening a file within a Jar is not right - findbugs reporting issues.
                
> jcasgen: load the descriptor from the classpath
> -----------------------------------------------
>
>                 Key: UIMA-1793
>                 URL: https://issues.apache.org/jira/browse/UIMA-1793
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Tools
>    Affects Versions: 2.2.2CE, 2.2.2AS, 2.2.2S, 2.1, 2.2, 2.2.1, 2.2.2
>            Reporter: Daniel Truemper
>            Assignee: Marshall Schor
>            Priority: Critical
>             Fix For: 2.3.1SDK
>
>         Attachments: uimaj-tools-jg.patch, uima-tools-jg2.patch
>
>
> Hi,
> I would like to propose a small patch to the Jg class (org.apache.uima.tools.jcasgen.Jg). At the moment it is only possible to generate the source code for the typesystem when the corresponding descriptor file is located somewhere on your disk. I have the use case, where I want the typesystem descriptor to be contained inside a (company wide) jar. That means, I need to load the typesystem descriptor from the classpath.
> The attached patch adds a little bit of extra info to the "-jcasgeninput" parameter ind the "main1" method. If the value starts with "classpath:" the patch will try to look for everything after "classpath:" with its ClassLoader. If the ClassLoader can find the resource and the "outputDirectory" is not null, everything works. If the ClassLoader cannot find the resource, the corresponding error is generated.
> If the "-jcasgeninput" parameter does not start with "classpath:" everything works as before, only that the file is being converted to an URL instance that is given to the XMLInputSource object.
> What I am not sure about it the use of the "xmlSourceFileName" member variable and what it should contain if the descriptor is loaded from the classpath. Actually I don't even know what this variable does...
> I have not found any unittest for this class. So the code is tested with my maven mojo and works as expected. If anyone can provide me with more info about how to test the Eclipse plugin I could also test this, but I certainly need help there...
> Any comments? Best
> Daniel

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira