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

Alban Perillat-Merceroz updated SQOOP-504:
------------------------------------------

    Description: 
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();

  was:
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).

    
> 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
>         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: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to