You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Chris K Wensel (JIRA)" <ji...@apache.org> on 2008/10/21 00:32:44 UTC

[jira] Created: (HADOOP-4467) SerializationFactory should use current contextClassLoader

SerializationFactory should use current contextClassLoader
----------------------------------------------------------

                 Key: HADOOP-4467
                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
             Project: Hadoop Core
          Issue Type: Bug
            Reporter: Chris K Wensel




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Chris K Wensel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris K Wensel updated HADOOP-4467:
-----------------------------------

    Status: Patch Available  (was: Open)

delegates back to Configuration

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>         Attachments: hadoop-4467-v2.patch, hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Tom White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641564#action_12641564 ] 

Tom White commented on HADOOP-4467:
-----------------------------------

+1

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>         Attachments: hadoop-4467-v2.patch, hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Chris K Wensel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris K Wensel updated HADOOP-4467:
-----------------------------------

    Attachment: hadoop-4467-v2.patch

delegates classloading back to Configuration

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>         Attachments: hadoop-4467-v2.patch, hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Chris K Wensel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris K Wensel updated HADOOP-4467:
-----------------------------------

    Status: Open  (was: Patch Available)

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>         Attachments: hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Chris K Wensel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641202#action_12641202 ] 

Chris K Wensel commented on HADOOP-4467:
----------------------------------------

I probably should have phrased this one differently, but it does seem to be standard practice to provide the context classloader when calling Class.forName.

I can submit a patch with the one line change. but I do not know if there should (or even could be) an accompanying unit test for this. please advise.

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1
>            Reporter: Chris K Wensel
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Chris K Wensel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris K Wensel updated HADOOP-4467:
-----------------------------------

    Priority: Blocker  (was: Major)

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>            Priority: Blocker
>         Attachments: hadoop-4467-v2.patch, hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642300#action_12642300 ] 

Hudson commented on HADOOP-4467:
--------------------------------

Integrated in Hadoop-trunk #640 (See [http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/640/])
    . SerializationFactory now uses the current context ClassLoader allowing for user supplied Serialization instances. Contributed by Chris Wensel.


> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>            Assignee: Chris K Wensel
>            Priority: Blocker
>             Fix For: 0.18.2
>
>         Attachments: hadoop-4467-v2.patch, hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Chris K Wensel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris K Wensel updated HADOOP-4467:
-----------------------------------

          Description: 
SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.

The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.
    Affects Version/s: 0.18.1
              Summary: SerializationFactory should use current context ClassLoader  (was: SerializationFactory should use current contextClassLoader)

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1
>            Reporter: Chris K Wensel
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Chris K Wensel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris K Wensel updated HADOOP-4467:
-----------------------------------

    Affects Version/s: 0.19.0

added 0.19 as an affected version

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Chris K Wensel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641729#action_12641729 ] 

Chris K Wensel commented on HADOOP-4467:
----------------------------------------

All but org.apache.hadoop.fs.TestLocalDirAllocator tests pass. 

I think this is unrelated:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>         Attachments: hadoop-4467-v2.patch, hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Chris K Wensel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641732#action_12641732 ] 

Chris K Wensel commented on HADOOP-4467:
----------------------------------------

via ant test-patch...

seems to be down on lack of tests. unsure, per previous comment, how to test classloader issues.

     [exec] -1 overall.  
     [exec] 
     [exec]     +1 @author.  The patch does not contain any @author tags.
     [exec] 
     [exec]     -1 tests included.  The patch doesn't appear to include any new or modified tests.
     [exec]                         Please justify why no tests are needed for this patch.
     [exec] 
     [exec]     +1 javadoc.  The javadoc tool did not generate any warning messages.
     [exec] 
     [exec]     +1 javac.  The applied patch does not increase the total number of javac compiler warnings.
     [exec] 
     [exec]     +1 findbugs.  The patch does not introduce any new Findbugs warnings.
     [exec] 

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>         Attachments: hadoop-4467-v2.patch, hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Chris K Wensel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641215#action_12641215 ] 

Chris K Wensel commented on HADOOP-4467:
----------------------------------------

agreed.

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>         Attachments: hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Chris K Wensel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris K Wensel updated HADOOP-4467:
-----------------------------------

    Release Note: SerializationFactory now uses the current context ClassLoader allowing for user supplied Serialization instances.
          Status: Patch Available  (was: Open)

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>         Attachments: hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641213#action_12641213 ] 

Owen O'Malley commented on HADOOP-4467:
---------------------------------------

Wouldn't it be better to use the class loader associated with the configuration rather than the current thread? Basically, use

{code}
   conf.getClassByName(name);
{code}

Clearly the conf for the serializer would need to be saved from the constructor.



> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>         Attachments: hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Arun C Murthy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arun C Murthy updated HADOOP-4467:
----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.18.2
         Assignee: Chris K Wensel
           Status: Resolved  (was: Patch Available)

I just committed this. Thanks, Chris!

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>            Assignee: Chris K Wensel
>            Priority: Blocker
>             Fix For: 0.18.2
>
>         Attachments: hadoop-4467-v2.patch, hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-4467) SerializationFactory should use current context ClassLoader

Posted by "Chris K Wensel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris K Wensel updated HADOOP-4467:
-----------------------------------

    Attachment: hadoop-4467.patch

initial attempt, without unit tests

> SerializationFactory should use current context ClassLoader
> -----------------------------------------------------------
>
>                 Key: HADOOP-4467
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4467
>             Project: Hadoop Core
>          Issue Type: Bug
>    Affects Versions: 0.18.1, 0.19.0
>            Reporter: Chris K Wensel
>         Attachments: hadoop-4467.patch
>
>
> SerializationFactory#add calls Class.forName without a ClassLoader instance. This prevents user-space Serialization classes from being loaded.
> The resulting ClassNotFoundException is eaten after being logged, and a NPE is thrown further down the line when a Serializer is requested.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.