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

Jarek Jarcec Cecho commented on SQOOP-2225:
-------------------------------------------

So I've dig into this one and it seems to me that the bug is not on client side 
nor on {{ThrowableBean}} side. We have util class 
[{{ClassUtils.loadClass}}|https://github.com/apache/sqoop/blob/sqoop2/common/src/main/java/org/apache/sqoop/utils/ClassUtils.java#L35]
 that we're using to load classes without the need to put extensive number of 
try-catch blocks around it. The method description clearly states that this 
method will never ever return an exception, so the {{ThrowableBean}} was 
written in a way to expect {{null}} on failure instead. From some reason we've 
changed that via SQOOP-1821 to throw the {{RuntimeException}}. I've checked the 
patch and I'm not immediately sure that why that happened, so my suggestion is 
to simply put back the original code. This will ensure that we won't randomly 
throw {{RuntimeException}} that we're not expecting and the exception 
propagation to client will again start working properly.

> Sqoop2: Shell client clobbers server exceptions
> -----------------------------------------------
>
>                 Key: SQOOP-2225
>                 URL: https://issues.apache.org/jira/browse/SQOOP-2225
>             Project: Sqoop
>          Issue Type: Bug
>          Components: sqoop2-shell
>            Reporter: Abraham Elmahrek
>            Assignee: Jarek Jarcec Cecho
>             Fix For: 1.99.7
>
>
> The Sqoop2 shell tries to re-create exceptions:
> {code}
> Exception has occurred during processing command 
> Exception: java.lang.RuntimeException Message: 
> java.lang.ClassNotFoundException: org.kitesdk.data.DatasetNotFoundException
> Stack trace:
>          at  org.apache.sqoop.utils.ClassUtils (ClassUtils.java:65) 
>          at  org.apache.sqoop.utils.ClassUtils (ClassUtils.java:84) 
>          at  org.apache.sqoop.json.ThrowableBean (ThrowableBean.java:123) 
>          at  org.apache.sqoop.client.request.ResourceRequest 
> (ResourceRequest.java:127) 
>          at  org.apache.sqoop.client.request.ResourceRequest 
> (ResourceRequest.java:179) 
>          at  org.apache.sqoop.client.request.JobResourceRequest 
> (JobResourceRequest.java:112) 
>          at  org.apache.sqoop.client.request.SqoopResourceRequests 
> (SqoopResourceRequests.java:157) 
>          at  org.apache.sqoop.client.SqoopClient (SqoopClient.java:452) 
>          at  org.apache.sqoop.shell.StartJobFunction 
> (StartJobFunction.java:80) 
>          at  org.apache.sqoop.shell.SqoopFunction (SqoopFunction.java:51) 
>          at  org.apache.sqoop.shell.SqoopCommand (SqoopCommand.java:149) 
>          at  org.apache.sqoop.shell.SqoopCommand (SqoopCommand.java:111) 
>          at  org.codehaus.groovy.tools.shell.Command$execute (null:-1) 
>          at  org.codehaus.groovy.runtime.callsite.CallSiteArray 
> (CallSiteArray.java:42) 
>          at  org.codehaus.groovy.tools.shell.Command$execute (null:-1) 
>          at  org.codehaus.groovy.tools.shell.Shell (Shell.groovy:101) 
>          at  org.codehaus.groovy.tools.shell.Groovysh (Groovysh.groovy:-1) 
>          at  sun.reflect.NativeMethodAccessorImpl 
> (NativeMethodAccessorImpl.java:-2) 
>          at  sun.reflect.NativeMethodAccessorImpl 
> (NativeMethodAccessorImpl.java:57) 
>          at  sun.reflect.DelegatingMethodAccessorImpl 
> (DelegatingMethodAccessorImpl.java:43) 
>          at  java.lang.reflect.Method (Method.java:606) 
>          at  org.codehaus.groovy.reflection.CachedMethod 
> (CachedMethod.java:90) 
>          at  groovy.lang.MetaMethod (MetaMethod.java:233) 
>          at  groovy.lang.MetaClassImpl (MetaClassImpl.java:1054) 
>          at  org.codehaus.groovy.runtime.ScriptBytecodeAdapter 
> (ScriptBytecodeAdapter.java:128) 
>          at  org.codehaus.groovy.tools.shell.Groovysh (Groovysh.groovy:173) 
>          at  sun.reflect.NativeMethodAccessorImpl 
> (NativeMethodAccessorImpl.java:-2) 
>          at  sun.reflect.NativeMethodAccessorImpl 
> (NativeMethodAccessorImpl.java:57) 
>          at  sun.reflect.DelegatingMethodAccessorImpl 
> (DelegatingMethodAccessorImpl.java:43) 
>          at  java.lang.reflect.Method (Method.java:606) 
>          at  
> org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce
>  (PogoMetaMethodSite.java:267) 
>          at  org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite 
> (PogoMetaMethodSite.java:52) 
>          at  org.codehaus.groovy.runtime.callsite.AbstractCallSite 
> (AbstractCallSite.java:141) 
>          at  org.codehaus.groovy.tools.shell.Groovysh (Groovysh.groovy:121) 
>          at  org.codehaus.groovy.tools.shell.Shell (Shell.groovy:114) 
>          at  org.codehaus.groovy.tools.shell.Shell$leftShift$0 (null:-1) 
>          at  org.codehaus.groovy.tools.shell.ShellRunner 
> (ShellRunner.groovy:88) 
>          at  org.codehaus.groovy.tools.shell.InteractiveShellRunner 
> (InteractiveShellRunner.groovy:-1) 
>          at  sun.reflect.NativeMethodAccessorImpl 
> (NativeMethodAccessorImpl.java:-2) 
>          at  sun.reflect.NativeMethodAccessorImpl 
> (NativeMethodAccessorImpl.java:57) 
>          at  sun.reflect.DelegatingMethodAccessorImpl 
> (DelegatingMethodAccessorImpl.java:43) 
>          at  java.lang.reflect.Method (Method.java:606) 
>          at  org.codehaus.groovy.reflection.CachedMethod 
> (CachedMethod.java:90) 
>          at  groovy.lang.MetaMethod (MetaMethod.java:233) 
>          at  groovy.lang.MetaClassImpl (MetaClassImpl.java:1054) 
>          at  org.codehaus.groovy.runtime.ScriptBytecodeAdapter 
> (ScriptBytecodeAdapter.java:128) 
>          at  org.codehaus.groovy.runtime.ScriptBytecodeAdapter 
> (ScriptBytecodeAdapter.java:148) 
>          at  org.codehaus.groovy.tools.shell.InteractiveShellRunner 
> (InteractiveShellRunner.groovy:100) 
>          at  sun.reflect.NativeMethodAccessorImpl 
> (NativeMethodAccessorImpl.java:-2) 
>          at  sun.reflect.NativeMethodAccessorImpl 
> (NativeMethodAccessorImpl.java:57) 
>          at  sun.reflect.DelegatingMethodAccessorImpl 
> (DelegatingMethodAccessorImpl.java:43) 
>          at  java.lang.reflect.Method (Method.java:606) 
>          at  
> org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce
>  (PogoMetaMethodSite.java:267) 
>          at  org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite 
> (PogoMetaMethodSite.java:52) 
>          at  org.codehaus.groovy.runtime.callsite.AbstractCallSite 
> (AbstractCallSite.java:137) 
>          at  org.codehaus.groovy.tools.shell.ShellRunner 
> (ShellRunner.groovy:57) 
>          at  org.codehaus.groovy.tools.shell.InteractiveShellRunner 
> (InteractiveShellRunner.groovy:-1) 
>          at  sun.reflect.NativeMethodAccessorImpl 
> (NativeMethodAccessorImpl.java:-2) 
>          at  sun.reflect.NativeMethodAccessorImpl 
> (NativeMethodAccessorImpl.java:57) 
>          at  sun.reflect.DelegatingMethodAccessorImpl 
> (DelegatingMethodAccessorImpl.java:43) 
>          at  java.lang.reflect.Method (Method.java:606) 
>          at  org.codehaus.groovy.reflection.CachedMethod 
> (CachedMethod.java:90) 
>          at  groovy.lang.MetaMethod (MetaMethod.java:233) 
>          at  groovy.lang.MetaClassImpl (MetaClassImpl.java:1054) 
>          at  org.codehaus.groovy.runtime.ScriptBytecodeAdapter 
> (ScriptBytecodeAdapter.java:128) 
>          at  org.codehaus.groovy.runtime.ScriptBytecodeAdapter 
> (ScriptBytecodeAdapter.java:148) 
>          at  org.codehaus.groovy.tools.shell.InteractiveShellRunner 
> (InteractiveShellRunner.groovy:66) 
>          at  java_lang_Runnable$run (null:-1) 
>          at  org.codehaus.groovy.runtime.callsite.CallSiteArray 
> (CallSiteArray.java:42) 
>          at  org.codehaus.groovy.runtime.callsite.AbstractCallSite 
> (AbstractCallSite.java:108) 
>          at  org.codehaus.groovy.runtime.callsite.AbstractCallSite 
> (AbstractCallSite.java:112) 
>          at  org.codehaus.groovy.tools.shell.Groovysh (Groovysh.groovy:463) 
>          at  org.codehaus.groovy.tools.shell.Groovysh (Groovysh.groovy:402) 
>          at  org.apache.sqoop.shell.SqoopShell (SqoopShell.java:130)
> {code}
> This clobbers the actual exception.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to