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 "John DeTreville (JIRA)" <ji...@apache.org> on 2008/10/17 21:45:44 UTC

[jira] Created: (HADOOP-4448) "hadoop jar" runs wrong jar file in case of name clash

"hadoop  jar" runs wrong jar file in case of name clash
-------------------------------------------------------

                 Key: HADOOP-4448
                 URL: https://issues.apache.org/jira/browse/HADOOP-4448
             Project: Hadoop Core
          Issue Type: Bug
          Components: util
         Environment: RHEL Linux
            Reporter: John DeTreville
             Fix For: 0.17.3


Imagine I run a command as follows:

    hadoop jar test.jar

Let's imagine that my main module in test.jar is named Sort.

Let's also imagine that some jar file in my CLASSPATH contains a module also named Sort, which also defines main.

Hadoop will run THAT jar file, not the one I specified.

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


[jira] Resolved: (HADOOP-4448) "hadoop jar" runs wrong jar file in case of name clash

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

Enis Soztutar resolved HADOOP-4448.
-----------------------------------

    Resolution: Won't Fix

Closing as won't fix. 

> "hadoop  jar" runs wrong jar file in case of name clash
> -------------------------------------------------------
>
>                 Key: HADOOP-4448
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4448
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: util
>         Environment: RHEL Linux
>            Reporter: John DeTreville
>             Fix For: 0.17.3
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Imagine I run a command as follows:
>     hadoop jar test.jar
> Let's imagine that my main module in test.jar is named Sort.
> Let's also imagine that some jar file in my CLASSPATH contains a module also named Sort, which also defines main.
> Hadoop will run THAT jar file, not the one I specified.

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


[jira] Commented: (HADOOP-4448) "hadoop jar" runs wrong jar file in case of name clash

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

Steve Loughran commented on HADOOP-4448:
----------------------------------------

I think in this situation, the correct action would be to halt early. Some check that the loaded class came from the test.jar would handle that -but there is no guarantee that other classes wouldn't clash; mixing classes with the same name is always a disaster unless you have something like OSGi to keep things under control. 



> "hadoop  jar" runs wrong jar file in case of name clash
> -------------------------------------------------------
>
>                 Key: HADOOP-4448
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4448
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: util
>         Environment: RHEL Linux
>            Reporter: John DeTreville
>             Fix For: 0.17.3
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Imagine I run a command as follows:
>     hadoop jar test.jar
> Let's imagine that my main module in test.jar is named Sort.
> Let's also imagine that some jar file in my CLASSPATH contains a module also named Sort, which also defines main.
> Hadoop will run THAT jar file, not the one I specified.

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


[jira] Commented: (HADOOP-4448) "hadoop jar" runs wrong jar file in case of name clash

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

John DeTreville commented on HADOOP-4448:
-----------------------------------------

I should have been more clear.

In my example, the jar file that was submitted and the jar file that was incorrectly run both had the same full class name.

Of course, my command line didn't mention the class name. It gave the name of a jar file. Hadoop looked at my jar file, found the class name inside, then loaded another jar file from the CLASSPATH that happened to have the same class name.

The simple fix for me was to change my class name, but it took an awfully long time to figure out what was wrong.

Cheers,
John



> "hadoop  jar" runs wrong jar file in case of name clash
> -------------------------------------------------------
>
>                 Key: HADOOP-4448
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4448
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: util
>         Environment: RHEL Linux
>            Reporter: John DeTreville
>             Fix For: 0.17.3
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Imagine I run a command as follows:
>     hadoop jar test.jar
> Let's imagine that my main module in test.jar is named Sort.
> Let's also imagine that some jar file in my CLASSPATH contains a module also named Sort, which also defines main.
> Hadoop will run THAT jar file, not the one I specified.

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


[jira] Commented: (HADOOP-4448) "hadoop jar" runs wrong jar file in case of name clash

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

Enis Soztutar commented on HADOOP-4448:
---------------------------------------

bq. In my example, the jar file that was submitted and the jar file that was incorrectly run both had the same full class name.
In java, the classname is really the package name + class name, and with the standard naming convention, the class names are unique. If any of two classes have the same name, then there is something wrong with the naming in the first place, you should have set the package name accordingly. 

As I understand this, there is nothing can be done here. I will close this as won't fix unless any one objects. 

> "hadoop  jar" runs wrong jar file in case of name clash
> -------------------------------------------------------
>
>                 Key: HADOOP-4448
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4448
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: util
>         Environment: RHEL Linux
>            Reporter: John DeTreville
>             Fix For: 0.17.3
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Imagine I run a command as follows:
>     hadoop jar test.jar
> Let's imagine that my main module in test.jar is named Sort.
> Let's also imagine that some jar file in my CLASSPATH contains a module also named Sort, which also defines main.
> Hadoop will run THAT jar file, not the one I specified.

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


[jira] Commented: (HADOOP-4448) "hadoop jar" runs wrong jar file in case of name clash

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12640695#action_12640695 ] 

Tsz Wo (Nicholas), SZE commented on HADOOP-4448:
------------------------------------------------

Does it work if the full class name, e.g. org.apache.hadoop.examples.Sort, is used?

> "hadoop  jar" runs wrong jar file in case of name clash
> -------------------------------------------------------
>
>                 Key: HADOOP-4448
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4448
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: util
>         Environment: RHEL Linux
>            Reporter: John DeTreville
>             Fix For: 0.17.3
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Imagine I run a command as follows:
>     hadoop jar test.jar
> Let's imagine that my main module in test.jar is named Sort.
> Let's also imagine that some jar file in my CLASSPATH contains a module also named Sort, which also defines main.
> Hadoop will run THAT jar file, not the one I specified.

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