sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyrill Alyoshin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SQOOP-504) Windows bug: unable to load jar
Date Tue, 21 May 2013 18:41:16 GMT

    [ https://issues.apache.org/jira/browse/SQOOP-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13663235#comment-13663235
] 

Kyrill Alyoshin commented on SQOOP-504:
---------------------------------------

Can we get it fixed, please? The patch is good and a straightforward one. This code {{URL
url = new URL("jar:file://" + new File(jarFile).getAbsolutePath() + "!/")}} doesn't generate
Windows complaint URLs for two reasons:

1. File.getAbsolutePath() doesn't generate a leading slash which is required for proper file
URL (file:///).
2. It also generate '\' directory delimiters, instead of '/'. (Note: this is not an issue
on latest JVMs).

Thanks.
                
> Windows bug: unable to load jar
> -------------------------------
>
>                 Key: SQOOP-504
>                 URL: https://issues.apache.org/jira/browse/SQOOP-504
>             Project: Sqoop
>          Issue Type: Bug
>          Components: codegen
>    Affects Versions: 1.4.2
>         Environment: Windows
>            Reporter: Alban Perillat-Merceroz
>            Assignee: Alban Perillat-Merceroz
>         Attachments: SQOOP-504.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> A piece of code was unix specific for loading a jar.
> The attached file is the a for a generic implementation (works for windows too).
> Edit.
> The issue is: Sqoop generates a jar file containing the generated class corresponding
to the DB table to import.
> his code tries to load the jar in order to read the class, but the path "jar:file://"
+ new File(jarFile).getAbsolutePath() + "!/" seems not to be a valid windows path.
> So I simply replaced the file path
> From this:
> URL url = new URL("jar:file://" + new File(jarFile).getAbsolutePath() + "!/")
> to this:
> URL url = new File(jarFile).toURI().toURL();

--
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

Mime
View raw message