You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Steve Loughran (Created) (JIRA)" <ji...@apache.org> on 2012/03/03 15:07:57 UTC
[jira] [Created] (MAPREDUCE-3965) JobConf.findContainingJar NPEs if
it can't find the classloader of a class
JobConf.findContainingJar NPEs if it can't find the classloader of a class
--------------------------------------------------------------------------
Key: MAPREDUCE-3965
URL: https://issues.apache.org/jira/browse/MAPREDUCE-3965
Project: Hadoop Map/Reduce
Issue Type: Bug
Environment: Setting up a job under Groovy
Reporter: Steve Loughran
Priority: Minor
I never knew that classes may not have classloaders, but it turns out they can -in which case Object.getClass().getClassLoader() will be null "This method will return null in such implementations if this class was loaded by the bootstrap class loader.""
When this (rare) situation arises, {{JobConf.findContainingJar()}} NPEs, when failing with a slightly more useful error message would be preferred.
--
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
[jira] [Commented] (MAPREDUCE-3965) JobConf.findContainingJar NPEs
if it can't find the classloader of a class
Posted by "Steve Loughran (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MAPREDUCE-3965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13221595#comment-13221595 ]
Steve Loughran commented on MAPREDUCE-3965:
-------------------------------------------
no, groovy triggers it for the same reason -user error.
Propose
# a check in {{findContainingJar}} to handle a null class
# if found, an IllegalArgumentException is raised -including the classname at fault
# a test that tries to set the class of a job to {{java.lang.Class}} and expects the relevant error
> JobConf.findContainingJar NPEs if it can't find the classloader of a class
> --------------------------------------------------------------------------
>
> Key: MAPREDUCE-3965
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-3965
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Affects Versions: 1.0.0
> Environment: Setting up a job under Groovy, OSX10.7, job started by ant's <java> with fork==true
> Reporter: Steve Loughran
> Priority: Minor
>
> I never knew that classes may not have classloaders, but it turns out they can -in which case Object.getClass().getClassLoader() will be null "This method will return null in such implementations if this class was loaded by the bootstrap class loader.""
> When this (rare) situation arises, {{JobConf.findContainingJar()}} NPEs, when failing with a slightly more useful error message would be preferred.
--
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
[jira] [Updated] (MAPREDUCE-3965) JobConf.findContainingJar NPEs if
it can't find the classloader of a class
Posted by "Steve Loughran (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MAPREDUCE-3965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steve Loughran updated MAPREDUCE-3965:
--------------------------------------
Affects Version/s: 0.24.0
0.23.0
> JobConf.findContainingJar NPEs if it can't find the classloader of a class
> --------------------------------------------------------------------------
>
> Key: MAPREDUCE-3965
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-3965
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Affects Versions: 0.23.0, 0.24.0, 1.0.0
> Environment: Setting up a job under Groovy, OSX10.7, job started by ant's <java> with fork==true
> Reporter: Steve Loughran
> Priority: Minor
>
> I never knew that classes may not have classloaders, but it turns out they can -in which case Object.getClass().getClassLoader() will be null "This method will return null in such implementations if this class was loaded by the bootstrap class loader.""
> When this (rare) situation arises, {{JobConf.findContainingJar()}} NPEs, when failing with a slightly more useful error message would be preferred.
--
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
[jira] [Commented] (MAPREDUCE-3965) JobConf.findContainingJar NPEs
if it can't find the classloader of a class
Posted by "Steve Loughran (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MAPREDUCE-3965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13221594#comment-13221594 ]
Steve Loughran commented on MAPREDUCE-3965:
-------------------------------------------
This is triggered if the Class passed down to the map class is class {{java.lang.Class}}
{code}
job.setJarByClass(Class.class);
{code}
Groovy seems to trigger it for other reasons
> JobConf.findContainingJar NPEs if it can't find the classloader of a class
> --------------------------------------------------------------------------
>
> Key: MAPREDUCE-3965
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-3965
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Affects Versions: 1.0.0
> Environment: Setting up a job under Groovy, OSX10.7, job started by ant's <java> with fork==true
> Reporter: Steve Loughran
> Priority: Minor
>
> I never knew that classes may not have classloaders, but it turns out they can -in which case Object.getClass().getClassLoader() will be null "This method will return null in such implementations if this class was loaded by the bootstrap class loader.""
> When this (rare) situation arises, {{JobConf.findContainingJar()}} NPEs, when failing with a slightly more useful error message would be preferred.
--
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
[jira] [Commented] (MAPREDUCE-3965) JobConf.findContainingJar NPEs
if it can't find the classloader of a class
Posted by "Steve Loughran (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MAPREDUCE-3965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13221592#comment-13221592 ]
Steve Loughran commented on MAPREDUCE-3965:
-------------------------------------------
stack trace
{code}
[java] Exception in thread "main" java.lang.NullPointerException
[java] at org.apache.hadoop.mapred.JobConf.findContainingJar(JobConf.java:1792)
[java] at org.apache.hadoop.mapred.JobConf.setJarByClass(JobConf.java:426)
[java] at org.apache.hadoop.mapreduce.Job.setJarByClass(Job.java:133)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
[java] at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
[java] at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2388)
[java] at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3312)
[java] at org.smartfrog.services.hadoop.grumpy.GrumpyJob.setProperty(GrumpyJob.groovy)
[java] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setGroovyObjectProperty(ScriptBytecodeAdapter.java:528)
[java] at org.smartfrog.services.hadoop.bluemine.jobs.BluemineJob.createBasicJob(BluemineJob.groovy:51)
[java] at org.smartfrog.services.hadoop.bluemine.jobs.BluemineJob$createBasicJob.call(Unknown Source)
[java] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
[java] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
[java] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
[java] at org.smartfrog.services.hadoop.bluemine.jobs.DevCount.main(DevCount.groovy:95)
{code}
> JobConf.findContainingJar NPEs if it can't find the classloader of a class
> --------------------------------------------------------------------------
>
> Key: MAPREDUCE-3965
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-3965
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Environment: Setting up a job under Groovy
> Reporter: Steve Loughran
> Priority: Minor
>
> I never knew that classes may not have classloaders, but it turns out they can -in which case Object.getClass().getClassLoader() will be null "This method will return null in such implementations if this class was loaded by the bootstrap class loader.""
> When this (rare) situation arises, {{JobConf.findContainingJar()}} NPEs, when failing with a slightly more useful error message would be preferred.
--
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
[jira] [Updated] (MAPREDUCE-3965) JobConf.findContainingJar NPEs if
it can't find the classloader of a class
Posted by "Steve Loughran (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/MAPREDUCE-3965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steve Loughran updated MAPREDUCE-3965:
--------------------------------------
Environment: Setting up a job under Groovy, OSX10.7, job started by ant's <java> with fork==true (was: Setting up a job under Groovy)
Affects Version/s: 1.0.0
> JobConf.findContainingJar NPEs if it can't find the classloader of a class
> --------------------------------------------------------------------------
>
> Key: MAPREDUCE-3965
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-3965
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Affects Versions: 1.0.0
> Environment: Setting up a job under Groovy, OSX10.7, job started by ant's <java> with fork==true
> Reporter: Steve Loughran
> Priority: Minor
>
> I never knew that classes may not have classloaders, but it turns out they can -in which case Object.getClass().getClassLoader() will be null "This method will return null in such implementations if this class was loaded by the bootstrap class loader.""
> When this (rare) situation arises, {{JobConf.findContainingJar()}} NPEs, when failing with a slightly more useful error message would be preferred.
--
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