You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Todd <bi...@163.com> on 2015/12/22 07:01:25 UTC

[Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Hi,
I have two jars, A and B. A contains the class that has the main method, B contains the mapper and reducer. A will collect B's mapper and reducer through reflection.
I am using the following commands to submit the job,but B's mapper class not found exception is thrown.
1.
$HADOOP_CLASSPATH=B.jar:other jars
hadoop jar A.jar

2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
3. hadoop jar A.jar -libjars B.jar

All the above three ways don't work. Can someone help me on this? Thanks!!


Re: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Posted by Brian Jeltema <bd...@gmail.com>.
try:
   
   export HADOOP_CLASSPATH=B.jar
   hadoop jar A.jar -libjars B.jar


> On Dec 22, 2015, at 1:01 AM, Todd <bi...@163.com> wrote:
> 
> Hi,
> I have two jars, A and B. A contains the class that has the main method, B contains the mapper and reducer. A will collect B's mapper and reducer through reflection.
> I am using the following commands to submit the job,but B's mapper class not found exception is thrown.
> 1. 
> $HADOOP_CLASSPATH=B.jar:other jars
> hadoop jar A.jar
> 
> 2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
> 3. hadoop jar A.jar -libjars B.jar
> 
> All the above three ways don't work. Can someone help me on this? Thanks!!
> 


Re: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Posted by Brian Jeltema <bd...@gmail.com>.
try:
   
   export HADOOP_CLASSPATH=B.jar
   hadoop jar A.jar -libjars B.jar


> On Dec 22, 2015, at 1:01 AM, Todd <bi...@163.com> wrote:
> 
> Hi,
> I have two jars, A and B. A contains the class that has the main method, B contains the mapper and reducer. A will collect B's mapper and reducer through reflection.
> I am using the following commands to submit the job,but B's mapper class not found exception is thrown.
> 1. 
> $HADOOP_CLASSPATH=B.jar:other jars
> hadoop jar A.jar
> 
> 2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
> 3. hadoop jar A.jar -libjars B.jar
> 
> All the above three ways don't work. Can someone help me on this? Thanks!!
> 


Re: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Posted by Brian Jeltema <bd...@gmail.com>.
try:
   
   export HADOOP_CLASSPATH=B.jar
   hadoop jar A.jar -libjars B.jar


> On Dec 22, 2015, at 1:01 AM, Todd <bi...@163.com> wrote:
> 
> Hi,
> I have two jars, A and B. A contains the class that has the main method, B contains the mapper and reducer. A will collect B's mapper and reducer through reflection.
> I am using the following commands to submit the job,but B's mapper class not found exception is thrown.
> 1. 
> $HADOOP_CLASSPATH=B.jar:other jars
> hadoop jar A.jar
> 
> 2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
> 3. hadoop jar A.jar -libjars B.jar
> 
> All the above three ways don't work. Can someone help me on this? Thanks!!
> 


Re: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Posted by Namikaze Minato <ll...@gmail.com>.
You could try:
HADOOP_CLASSPATH=B.jar:C.jar:D.jar hadoop jar A.jar
(space, not semicolumn)

Regards,
LLoyd

On 22 December 2015 at 17:21, Frank Luo <jl...@merkleinc.com> wrote:

> Make sure you call job.setJarByClass with right parameters.
> http://stackoverflow.com/questions/3912267/hadoop-query-regarding-setjarbyclass-method-of-job-class
>
>
>
> Other than that, try to do 2 and 3 together just to test it out. There is
> no reason it doesn’t work.
>
>
>
> *From:* Todd [mailto:bit1129@163.com]
> *Sent:* Tuesday, December 22, 2015 12:01 AM
> *To:* user@hadoop.apache.org
> *Subject:* [Classpath Issue]NoClassFoundException occurs when depending
> on the 3rd jar
>
>
>
> Hi,
> I have two jars, A and B. A contains the class that has the main method, B
> contains the mapper and reducer. A will collect B's mapper and reducer
> through reflection.
> I am using the following commands to submit the job,but B's mapper class
> not found exception is thrown.
> 1.
> $HADOOP_CLASSPATH=B.jar:other jars
> hadoop jar A.jar
>
> 2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
> 3. hadoop jar A.jar -libjars B.jar
>
> All the above three ways don't work. Can someone help me on this? Thanks!!
>
> This email and any attachments transmitted with it are intended for use by
> the intended recipient(s) only. If you have received this email in error,
> please notify the sender immediately and then delete it. If you are not the
> intended recipient, you must not keep, use, disclose, copy or distribute
> this email without the author’s prior permission. We take precautions to
> minimize the risk of transmitting software viruses, but we advise you to
> perform your own virus checks on any attachment to this message. We cannot
> accept liability for any loss or damage caused by software viruses. The
> information contained in this communication may be confidential and may be
> subject to the attorney-client privilege.
>

Re: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Posted by Namikaze Minato <ll...@gmail.com>.
You could try:
HADOOP_CLASSPATH=B.jar:C.jar:D.jar hadoop jar A.jar
(space, not semicolumn)

Regards,
LLoyd

On 22 December 2015 at 17:21, Frank Luo <jl...@merkleinc.com> wrote:

> Make sure you call job.setJarByClass with right parameters.
> http://stackoverflow.com/questions/3912267/hadoop-query-regarding-setjarbyclass-method-of-job-class
>
>
>
> Other than that, try to do 2 and 3 together just to test it out. There is
> no reason it doesn’t work.
>
>
>
> *From:* Todd [mailto:bit1129@163.com]
> *Sent:* Tuesday, December 22, 2015 12:01 AM
> *To:* user@hadoop.apache.org
> *Subject:* [Classpath Issue]NoClassFoundException occurs when depending
> on the 3rd jar
>
>
>
> Hi,
> I have two jars, A and B. A contains the class that has the main method, B
> contains the mapper and reducer. A will collect B's mapper and reducer
> through reflection.
> I am using the following commands to submit the job,but B's mapper class
> not found exception is thrown.
> 1.
> $HADOOP_CLASSPATH=B.jar:other jars
> hadoop jar A.jar
>
> 2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
> 3. hadoop jar A.jar -libjars B.jar
>
> All the above three ways don't work. Can someone help me on this? Thanks!!
>
> This email and any attachments transmitted with it are intended for use by
> the intended recipient(s) only. If you have received this email in error,
> please notify the sender immediately and then delete it. If you are not the
> intended recipient, you must not keep, use, disclose, copy or distribute
> this email without the author’s prior permission. We take precautions to
> minimize the risk of transmitting software viruses, but we advise you to
> perform your own virus checks on any attachment to this message. We cannot
> accept liability for any loss or damage caused by software viruses. The
> information contained in this communication may be confidential and may be
> subject to the attorney-client privilege.
>

Re: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Posted by Namikaze Minato <ll...@gmail.com>.
You could try:
HADOOP_CLASSPATH=B.jar:C.jar:D.jar hadoop jar A.jar
(space, not semicolumn)

Regards,
LLoyd

On 22 December 2015 at 17:21, Frank Luo <jl...@merkleinc.com> wrote:

> Make sure you call job.setJarByClass with right parameters.
> http://stackoverflow.com/questions/3912267/hadoop-query-regarding-setjarbyclass-method-of-job-class
>
>
>
> Other than that, try to do 2 and 3 together just to test it out. There is
> no reason it doesn’t work.
>
>
>
> *From:* Todd [mailto:bit1129@163.com]
> *Sent:* Tuesday, December 22, 2015 12:01 AM
> *To:* user@hadoop.apache.org
> *Subject:* [Classpath Issue]NoClassFoundException occurs when depending
> on the 3rd jar
>
>
>
> Hi,
> I have two jars, A and B. A contains the class that has the main method, B
> contains the mapper and reducer. A will collect B's mapper and reducer
> through reflection.
> I am using the following commands to submit the job,but B's mapper class
> not found exception is thrown.
> 1.
> $HADOOP_CLASSPATH=B.jar:other jars
> hadoop jar A.jar
>
> 2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
> 3. hadoop jar A.jar -libjars B.jar
>
> All the above three ways don't work. Can someone help me on this? Thanks!!
>
> This email and any attachments transmitted with it are intended for use by
> the intended recipient(s) only. If you have received this email in error,
> please notify the sender immediately and then delete it. If you are not the
> intended recipient, you must not keep, use, disclose, copy or distribute
> this email without the author’s prior permission. We take precautions to
> minimize the risk of transmitting software viruses, but we advise you to
> perform your own virus checks on any attachment to this message. We cannot
> accept liability for any loss or damage caused by software viruses. The
> information contained in this communication may be confidential and may be
> subject to the attorney-client privilege.
>

Re: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Posted by Namikaze Minato <ll...@gmail.com>.
You could try:
HADOOP_CLASSPATH=B.jar:C.jar:D.jar hadoop jar A.jar
(space, not semicolumn)

Regards,
LLoyd

On 22 December 2015 at 17:21, Frank Luo <jl...@merkleinc.com> wrote:

> Make sure you call job.setJarByClass with right parameters.
> http://stackoverflow.com/questions/3912267/hadoop-query-regarding-setjarbyclass-method-of-job-class
>
>
>
> Other than that, try to do 2 and 3 together just to test it out. There is
> no reason it doesn’t work.
>
>
>
> *From:* Todd [mailto:bit1129@163.com]
> *Sent:* Tuesday, December 22, 2015 12:01 AM
> *To:* user@hadoop.apache.org
> *Subject:* [Classpath Issue]NoClassFoundException occurs when depending
> on the 3rd jar
>
>
>
> Hi,
> I have two jars, A and B. A contains the class that has the main method, B
> contains the mapper and reducer. A will collect B's mapper and reducer
> through reflection.
> I am using the following commands to submit the job,but B's mapper class
> not found exception is thrown.
> 1.
> $HADOOP_CLASSPATH=B.jar:other jars
> hadoop jar A.jar
>
> 2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
> 3. hadoop jar A.jar -libjars B.jar
>
> All the above three ways don't work. Can someone help me on this? Thanks!!
>
> This email and any attachments transmitted with it are intended for use by
> the intended recipient(s) only. If you have received this email in error,
> please notify the sender immediately and then delete it. If you are not the
> intended recipient, you must not keep, use, disclose, copy or distribute
> this email without the author’s prior permission. We take precautions to
> minimize the risk of transmitting software viruses, but we advise you to
> perform your own virus checks on any attachment to this message. We cannot
> accept liability for any loss or damage caused by software viruses. The
> information contained in this communication may be confidential and may be
> subject to the attorney-client privilege.
>

RE: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Posted by Frank Luo <jl...@merkleinc.com>.
Make sure you call job.setJarByClass with right parameters. http://stackoverflow.com/questions/3912267/hadoop-query-regarding-setjarbyclass-method-of-job-class

Other than that, try to do 2 and 3 together just to test it out. There is no reason it doesn’t work.

From: Todd [mailto:bit1129@163.com]
Sent: Tuesday, December 22, 2015 12:01 AM
To: user@hadoop.apache.org
Subject: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Hi,
I have two jars, A and B. A contains the class that has the main method, B contains the mapper and reducer. A will collect B's mapper and reducer through reflection.
I am using the following commands to submit the job,but B's mapper class not found exception is thrown.
1.
$HADOOP_CLASSPATH=B.jar:other jars
hadoop jar A.jar

2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
3. hadoop jar A.jar -libjars B.jar

All the above three ways don't work. Can someone help me on this? Thanks!!

This email and any attachments transmitted with it are intended for use by the intended recipient(s) only. If you have received this email in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this email without the author’s prior permission. We take precautions to minimize the risk of transmitting software viruses, but we advise you to perform your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. The information contained in this communication may be confidential and may be subject to the attorney-client privilege.

RE: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Posted by Frank Luo <jl...@merkleinc.com>.
Make sure you call job.setJarByClass with right parameters. http://stackoverflow.com/questions/3912267/hadoop-query-regarding-setjarbyclass-method-of-job-class

Other than that, try to do 2 and 3 together just to test it out. There is no reason it doesn’t work.

From: Todd [mailto:bit1129@163.com]
Sent: Tuesday, December 22, 2015 12:01 AM
To: user@hadoop.apache.org
Subject: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Hi,
I have two jars, A and B. A contains the class that has the main method, B contains the mapper and reducer. A will collect B's mapper and reducer through reflection.
I am using the following commands to submit the job,but B's mapper class not found exception is thrown.
1.
$HADOOP_CLASSPATH=B.jar:other jars
hadoop jar A.jar

2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
3. hadoop jar A.jar -libjars B.jar

All the above three ways don't work. Can someone help me on this? Thanks!!

This email and any attachments transmitted with it are intended for use by the intended recipient(s) only. If you have received this email in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this email without the author’s prior permission. We take precautions to minimize the risk of transmitting software viruses, but we advise you to perform your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. The information contained in this communication may be confidential and may be subject to the attorney-client privilege.

RE: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Posted by Frank Luo <jl...@merkleinc.com>.
Make sure you call job.setJarByClass with right parameters. http://stackoverflow.com/questions/3912267/hadoop-query-regarding-setjarbyclass-method-of-job-class

Other than that, try to do 2 and 3 together just to test it out. There is no reason it doesn’t work.

From: Todd [mailto:bit1129@163.com]
Sent: Tuesday, December 22, 2015 12:01 AM
To: user@hadoop.apache.org
Subject: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Hi,
I have two jars, A and B. A contains the class that has the main method, B contains the mapper and reducer. A will collect B's mapper and reducer through reflection.
I am using the following commands to submit the job,but B's mapper class not found exception is thrown.
1.
$HADOOP_CLASSPATH=B.jar:other jars
hadoop jar A.jar

2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
3. hadoop jar A.jar -libjars B.jar

All the above three ways don't work. Can someone help me on this? Thanks!!

This email and any attachments transmitted with it are intended for use by the intended recipient(s) only. If you have received this email in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this email without the author’s prior permission. We take precautions to minimize the risk of transmitting software viruses, but we advise you to perform your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. The information contained in this communication may be confidential and may be subject to the attorney-client privilege.

Re: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Posted by Brian Jeltema <bd...@gmail.com>.
try:
   
   export HADOOP_CLASSPATH=B.jar
   hadoop jar A.jar -libjars B.jar


> On Dec 22, 2015, at 1:01 AM, Todd <bi...@163.com> wrote:
> 
> Hi,
> I have two jars, A and B. A contains the class that has the main method, B contains the mapper and reducer. A will collect B's mapper and reducer through reflection.
> I am using the following commands to submit the job,but B's mapper class not found exception is thrown.
> 1. 
> $HADOOP_CLASSPATH=B.jar:other jars
> hadoop jar A.jar
> 
> 2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
> 3. hadoop jar A.jar -libjars B.jar
> 
> All the above three ways don't work. Can someone help me on this? Thanks!!
> 


RE: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Posted by Frank Luo <jl...@merkleinc.com>.
Make sure you call job.setJarByClass with right parameters. http://stackoverflow.com/questions/3912267/hadoop-query-regarding-setjarbyclass-method-of-job-class

Other than that, try to do 2 and 3 together just to test it out. There is no reason it doesn’t work.

From: Todd [mailto:bit1129@163.com]
Sent: Tuesday, December 22, 2015 12:01 AM
To: user@hadoop.apache.org
Subject: [Classpath Issue]NoClassFoundException occurs when depending on the 3rd jar

Hi,
I have two jars, A and B. A contains the class that has the main method, B contains the mapper and reducer. A will collect B's mapper and reducer through reflection.
I am using the following commands to submit the job,but B's mapper class not found exception is thrown.
1.
$HADOOP_CLASSPATH=B.jar:other jars
hadoop jar A.jar

2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
3. hadoop jar A.jar -libjars B.jar

All the above three ways don't work. Can someone help me on this? Thanks!!

This email and any attachments transmitted with it are intended for use by the intended recipient(s) only. If you have received this email in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this email without the author’s prior permission. We take precautions to minimize the risk of transmitting software viruses, but we advise you to perform your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. The information contained in this communication may be confidential and may be subject to the attorney-client privilege.