[
https://issues.apache.org/jira/browse/SQOOP-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13399131#comment-13399131
]
Jarek Jarcec Cecho commented on SQOOP-504:
------------------------------------------
Hi Alban,
sorry that I did not get to you earlier. I would like fully understand the
issue before any fixes, could you describe what defect are you solving? I would
like to get same issue in my environment and see how it's being fixed by your
patch.
You're attachment do not seem to me as a valid patch - all lines do have at
least two numbers prepended. Could you generate real patch and attach it?
Something like
svn diff > SQOOP-504.patch
git diff > SQOOP-504.patch
Licensing policy is very strict here at Apache so that I can't alter your patch
in any way - it must be applicable on current trunk without any modifications.
Jarcec
> 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.txt
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> A piece of code was unix specific for loading a jar.
> Here is the patch for a generic implementation (works for windows too):
> (Or see github pull request : https://github.com/apache/sqoop/pull/1)
> src/java/org/apache/sqoop/util/ClassLoaderStack.java
> old new
> ... ... @@ -75,10 +75,10 @@ public final class ClassLoaderStack {
> 75 75 }
> 76 76 }
> 77 77
> 78 - String urlPath = "jar:file://" + new
> File(jarFile).getAbsolutePath() + "!/";
> 79 - LOG.debug("Attempting to load jar through URL: " +
> urlPath);
> 78 + URL url = new File(jarFile).toURI().toURL();
> 79 + LOG.debug("Attempting to load jar through URL: " + url);
> 80 80 LOG.debug("Previous classloader is " + prevClassLoader);
> 81 - URL [] jarUrlArray = {new URL(urlPath)};
> 81 + URL[] jarUrlArray = { url };
> 82 82 URLClassLoader cl = URLClassLoader.newInstance(jarUrlArray,
> 83 83 prevClassLoader);
> 84 84 try {
> ... ... @@ -87,7 +87,7 @@ public final class ClassLoaderStack {
> 87 87 LOG.debug("Testing class in jar: " + testClassName);
> 88 88 Class.forName(testClassName, true, cl);
> 89 89 }
> 90 - LOG.debug("Loaded jar into current JVM: " + urlPath);
> 90 + LOG.debug("Loaded jar into current JVM: " + url);
> 91 91 } catch (ClassNotFoundException cnfe) {
> 92 92 throw new IOException("Could not load jar " + jarFile
> 93 93 + " into JVM. (Could not find class "
--
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