Kazuomi Kashii created GORA-133:
-----------------------------------

             Summary: GoraCompiler cannot compile array type.
                 Key: GORA-133
                 URL: https://issues.apache.org/jira/browse/GORA-133
             Project: Apache Gora
          Issue Type: Bug
          Components: schema
            Reporter: Kazuomi Kashii
         Attachments: GORA-133.patch

test.json has:
    { "name": "arrayString", "type": { "type" : "array", "items" : "string" } },
bin/gora compile test.json .
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/gora/compiler/GoraCompiler
Caused by: java.lang.ClassNotFoundException: 
org.apache.gora.compiler.GoraCompiler
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Here is the path to fix this issue:

diff --git gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java 
gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java
index cf0ca83..ec1e53d 100644
--- gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java
+++ gora-core/src/main/java/org/apache/gora/compiler/GoraCompiler.java
@@ -324,7 +324,7 @@ public class GoraCompiler {
             break;
           case ARRAY:
             unboxed = unbox(fieldSchema.getElementType());
-            fieldType = type(fieldSchema.getValueType());
+            fieldType = type(fieldSchema.getElementType());
             line(1, "public GenericArray<"+fieldType+"> get"+camelKey+"() {");
             line(2, "return (GenericArray<"+fieldType+">) get("+i+");");
             line(1, "}");


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to