You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gora.apache.org by "Renato Javier Marroquín Mogrovejo (JIRA)" <ji...@apache.org> on 2014/05/27 14:45:03 UTC

[jira] [Commented] (GORA-332) Gora 0.4 compiler generate invalid Java code

    [ https://issues.apache.org/jira/browse/GORA-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14009630#comment-14009630 ] 

Renato Javier Marroquín Mogrovejo commented on GORA-332:
--------------------------------------------------------

Hi [~drazzib],

I might be missing something in your command but I don't fully understand it. Because you are putting into the classpath avro and jackson jars, and then reading the names from the test folder to execute those classes right? Aren't you just missing some compiled classes from $GORA_HOME/$MODULE/target/classes/ on your CP argument? This is because Gora is Avro complaint but we probably have some other dependencies in the middle. 
Then another question is how do you ensure that the org.apache.gora.compiler.cli.GoraCompilerCLI is the actual class being run? I am sorry if this a naive question, but I am unsure of what your "test" directory contains.
Thanks!


> Gora 0.4 compiler generate invalid Java code
> --------------------------------------------
>
>                 Key: GORA-332
>                 URL: https://issues.apache.org/jira/browse/GORA-332
>             Project: Apache Gora
>          Issue Type: Bug
>          Components: gora-compiler
>    Affects Versions: 0.4, 0.5
>            Reporter: Damien Raude-Morvan
>
> Pursuing my journey on GORA-199 I've detected another issue with Gora compiler.if there is a "bytes" type field inside a record.
> {noformat}
> {
>     "name": "RecordWityBytes",
>     "namespace": "com.drazzib.com",
>     "type": "record",
>     "fields": [
>         {
>             "name": "type",
>             "type": {
>                 "name": "MyData",
>                 "type": "bytes"
>             }
>         }
>     ]
> }
> {noformat}
> Gora 0.4 will generate java code without crashing but if you try to compile generated code with javac, you'll get the following error :
> {noformat}
> $> ./bin/gora goracompiler record_with_bytes.avsc test/
> Compiling: /home/drazzib/incoming/apache-gora-0.4/record_with_bytes.avsc
> Compiled into: /home/drazzib/incoming/apache-gora-0.4/test
> Compiler executed SUCCESSFULL.
> $> find test/ -name *.java | xargs javac -cp gora-core/target/classes/:gora-core/lib/avro-1.7.4.jar:gora-core/lib/jackson-core-asl-1.6.9.jar -d test/
> test/com/drazzib/com/RecordWityBytes.java:92: error: cannot find symbol
>     this.type = deepCopyToReadOnlyBuffer(value);
>                 ^
>   symbol:   method deepCopyToReadOnlyBuffer(ByteBuffer)
>   location: class RecordWityBytes
> 1 error
> {noformat}
> You can clone this gist [https://gist.github.com/drazzib/263da2ec0dc46afac0d0] to easily reproduce this issue.



--
This message was sent by Atlassian JIRA
(v6.2#6252)