[
https://issues.apache.org/jira/browse/CTAKES-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16356045#comment-16356045
]
Ewan Mellor commented on CTAKES-445:
------------------------------------
[~james-masanz]: Commit 1810271 above makes no sense to me.
{{- File configFile = new File(dr.getUri());}}
{{+ File configFile = new File(dr.getUrl().toExternalForm());}}
dr.getUrl() returns a java.net.URL. In my case, this is a file: URL. If I
understand correctly from the discussion above, then that's expected; if you
have unpacked ctakes-resources-lvg2008-4.0.0.jar onto the classpath, then
you're going to get a local file: URL here.
.toExternalForm() then gives a string with "file:/" at the front.
new File(String) expects a path, not a URL, so it tries to find a file called
"file:/...", which will never work.
In the old code, it was calling the File(URI) constructor, so it should have
worked for unpacked resources (though neither version would have worked for
jar: URLs). In the new code, I don't see how any situation works now.
I guess it's possible that some platforms are silently translating file: to
local paths inside the File(String) constructor. Mine isn't doing that though
(macOS 10.13.3, Java 1.8.0_151).
> java.lang.IllegalArgumentException: URI is not hierarchical -
> org.apache.ctakes.lvg.resource.LvgCmdApiResourceImpl.load
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: CTAKES-445
> URL: https://issues.apache.org/jira/browse/CTAKES-445
> Project: cTAKES
> Issue Type: Bug
> Components: ctakes-lvg
> Affects Versions: 4.0.0
> Reporter: James Joseph Masanz
> Assignee: James Joseph Masanz
> Priority: Major
> Fix For: 4.0.1
>
> Attachments: ctakes-445.patch
>
>
> Dima reported this on the dev@ list:
> http://markmail.org/message/l6mct3btk3nb43ld
> http://mail-archives.apache.org/mod_mbox/ctakes-dev/201704.mbox/%3CF00347B9-4228-4407-B566-4EB2774B21B5%40luc.edu%3E
> When using cTAKES as maven dependency and invoking his (Dima's) program using:
> mvn exec:java
> -Dexec.mainClass=“org.apache.ctakes.pipelines.UmlsLookupPipeline”
> Not sure which release this originated in. reproduced it in 4.0
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)