[
https://issues.apache.org/jira/browse/HADOOP-15137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16301809#comment-16301809
]
Bharat Viswanadham edited comment on HADOOP-15137 at 12/22/17 6:57 PM:
-----------------------------------------------------------------------
[~djp]
There are some classes in dnsjava jar with out package.
When I have below code for relocation
{code:java}
<relocation>
<pattern>dig</pattern>
<shadedPattern>${shaded.dependency.prefix}.</shadedPattern>
</relocation>
<relocation>
<pattern>jnamed</pattern>
<shadedPattern>${shaded.dependency.prefix}.</shadedPattern>
</relocation>
<relocation>
<pattern>lookup</pattern>
<shadedPattern>${shaded.dependency.prefix}.</shadedPattern>
</relocation>
<relocation>
<pattern>update</pattern>
<shadedPattern>${shaded.dependency.prefix}.</shadedPattern>
</relocation>
{code}
When I use above code, the following classes are shaded in
org.apache.hadoop.shaded, but they are named as $1.class, $2.class
{code:java}
HW13865:shaded bviswanadham$ ls ./org/apache/hadoop/shaded/
$1.class $2.class $3.class com io
javax jersey microsoft org
1. can we leave these classes unshaded, so that we can fix in
ensure-jar-correctness.sh.
2. Can we exclude these classes, when I searched for usage of these code it is
never used. I think they are utility classes for users, but not completely sure.
3. Do you have any other approach to solve this?
{code}
Attached the patch.
was (Author: bharatviswa):
[~djp]
There are some classes in dnsjava jar with out package.
When I have below code for relocation
{code:java}
<relocation>
<pattern>dig</pattern>
<shadedPattern>${shaded.dependency.prefix}.</shadedPattern>
</relocation>
<relocation>
<pattern>jnamed</pattern>
<shadedPattern>${shaded.dependency.prefix}.</shadedPattern>
</relocation>
<relocation>
<pattern>lookup</pattern>
<shadedPattern>${shaded.dependency.prefix}.</shadedPattern>
</relocation>
<relocation>
<pattern>update</pattern>
<shadedPattern>${shaded.dependency.prefix}.</shadedPattern>
</relocation>
{code}
When I use above code, the following classes are shaded in
org.apache.hadoop.shaded, but they are named as $1.class, $2.class
{code:java}
HW13865:shaded bviswanadham$ ls ./org/apache/hadoop/shaded/
$1.class $2.class $3.class com io
javax jersey microsoft org
1. can we leave these classes unshaded?
2. Can we exclude these classes, when I searched for usage of these code it is
never used. I think they are utility classes for users, but not completely sure.
3. Do you have any other approach to solve this?
{code}
Attached the patch.
> ClassNotFoundException:
> org.apache.hadoop.yarn.server.api.DistributedSchedulingAMProtocol when using
> hadoop-client-minicluster
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: HADOOP-15137
> URL: https://issues.apache.org/jira/browse/HADOOP-15137
> Project: Hadoop Common
> Issue Type: Sub-task
> Affects Versions: 3.0.0
> Reporter: Jeff Zhang
> Assignee: Bharat Viswanadham
> Attachments: HADOOP-15137.01.patch, YARN-7673.00.patch
>
>
> I'd like to use hadoop-client-minicluster for hadoop downstream project, but
> I encounter the following exception when starting hadoop minicluster. And I
> check the hadoop-client-minicluster, it indeed does not have this class. Is
> this something that is missing when packaging the published jar ?
> {code}
> java.lang.NoClassDefFoundError:
> org/apache/hadoop/yarn/server/api/DistributedSchedulingAMProtocol
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
> at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
> at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> at
> org.apache.hadoop.yarn.server.MiniYARNCluster.createResourceManager(MiniYARNCluster.java:851)
> at
> org.apache.hadoop.yarn.server.MiniYARNCluster.serviceInit(MiniYARNCluster.java:285)
> at
> org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]