gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henry Saputra <henry.sapu...@gmail.com>
Subject Re: A bug when the method Class.getCanonicalName() is used in org.apache.gora.util.IOUtils.java
Date Thu, 08 Nov 2012 22:03:02 GMT
Thanks, I think GORA-172 (https://issues.apache.org/jira/browse/GORA-172)
describes this problem.

The patch looks good but we need a way to repro this. How did you reproduce
the bug?

- Henry


On Thu, Nov 4, 2010 at 5:27 AM, yumeng <yumeng11345@gmail.com> wrote:

> 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
> JobConf#setJar(String).
> Exception in thread "main" java.lang.RuntimeException:
> java.io.IOException: java.lang.ClassNotFoundException:
> org.apache.gora.memory.store.MemStore.MemQuery
>         at
> org.apache.gora.mapreduce.GoraInputFormat.setConf(GoraInputFormat.java:109)
>         at
> org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62)
>         at
> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)
>         at
> org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:882)
>         at
> org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:779)
>         at org.apache.hadoop.mapreduce.Job.submit(Job.java:432)
>         at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:447)
>         at
> org.apache.gora.examples.mapreduce.WordCount.wordCount(WordCount.java:142)
>         at
> org.apache.gora.examples.mapreduce.WordCount.run(WordCount.java:166)
>         at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
>         at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
>         at
> org.apache.gora.examples.mapreduce.WordCount.main(WordCount.java:175)
> Caused by: java.io.IOException: java.lang.ClassNotFoundException:
> org.apache.gora.memory.store.MemStore.MemQuery
>         at org.apache.gora.util.IOUtils.loadFromConf(IOUtils.java:485)
>         at
> org.apache.gora.mapreduce.GoraInputFormat.getQuery(GoraInputFormat.java:119)
>         at
> org.apache.gora.mapreduce.GoraInputFormat.setConf(GoraInputFormat.java:106)
>         ... 11 more
> Caused by: java.lang.ClassNotFoundException:
> org.apache.gora.memory.store.MemStore.MemQuery
>         at java.net.URLClassLoader$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(Unknown 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(IOUtils.java:482)
>         ... 13 more
>
> ================================
> Obviously, Class.forName() can't find the Class:
> org.apache.gora.memory.store.MemStore.MemQuery.    In fact, MemQuery
> is a static inner Class in MemStore.  Its name should be
> "org.apache.gora.memory.store.MemStore$MemQuery" ,  but not
> "org.apache.gora.memory.store.MemStore.MemQuery".
>
> When we invoke Class.forName(), we can get the result as
> "org.apache.gora.memory.store.MemStore$MemQuery",while
> Class.getCanonicalName() only return
> "org.apache.gora.memory.store.MemStore.MemQuery".   Class.forName()
> can only recognize the the result of Class.getName().  Do you will
> change the code from getCanonicalName()  to getName()  in
> org.apache.gora.util.IOUtils.java???  There are two places where
> getCanonicalName() is used.
>
> After I change all getCanonicalName()  to getName()  in
> org.apache.gora.util.IOUtils.java, everything looks OK!
>
> My JDK is 1.6.22.
> Both in windows and in ubuntu, there exists this problem.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message