incubator-gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yumeng <>
Subject A bug when the method Class.getCanonicalName() is used in
Date Thu, 04 Nov 2010 12:27:41 GMT
Hi all:
   I have run some test in Gora-core, but I get some exceptions as belows:

10/11/04 20:19:15 WARN mapred.JobClient: No job jar file set.  User
classes may not be found. See JobConf(Class) or
Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException:
	at org.apache.gora.mapreduce.GoraInputFormat.setConf(
	at org.apache.hadoop.util.ReflectionUtils.setConf(
	at org.apache.hadoop.util.ReflectionUtils.newInstance(
	at org.apache.hadoop.mapred.JobClient.writeNewSplits(
	at org.apache.hadoop.mapred.JobClient.submitJobInternal(
	at org.apache.hadoop.mapreduce.Job.submit(
	at org.apache.hadoop.mapreduce.Job.waitForCompletion(
	at org.apache.gora.examples.mapreduce.WordCount.wordCount(
	at org.apache.gora.examples.mapreduce.WordCount.main(
Caused by: java.lang.ClassNotFoundException:
	at org.apache.gora.util.IOUtils.loadFromConf(
	at org.apache.gora.mapreduce.GoraInputFormat.getQuery(
	at org.apache.gora.mapreduce.GoraInputFormat.setConf(
	... 11 more
Caused by: java.lang.ClassNotFoundException:
	at$ Source)
	at Method)
	at Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at org.apache.gora.util.IOUtils.loadFromConf(
	... 13 more

Obviously, Class.forName() can't find the Class:    In fact, MemQuery
is a static inner Class in MemStore.  Its name should be
"$MemQuery" ,  but not

When we invoke Class.forName(), we can get the result as
Class.getCanonicalName() only return
"".   Class.forName()
can only recognize the the result of Class.getName().  Do you will
change the code from getCanonicalName()  to getName()  in  There are two places where
getCanonicalName() is used.

After I change all getCanonicalName()  to getName()  in, everything looks OK!

My JDK is 1.6.22.
Both in windows and in ubuntu, there exists this problem.

View raw message