[
https://issues.apache.org/jira/browse/AVRO-2682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17015994#comment-17015994
]
Ryan Skraba commented on AVRO-2682:
-----------------------------------
Hello! Are you sure that you're including Avro 1.9 in the project that is
compiling your specific record? The [^ResolvingDecoder.java] and
[^SpecificRecordBase.java] that you've attached are identical to the
release-1.8.2 versions, not the release-1.9.1 versions.
I can reproduce this by including your Test.java in a project that uses Avro
1.8.2, but not in a project that uses Avro 1.9.1, so I suspect that might be
it.
If this is the case, the right solution is to ensure that the version of Avro
generating code is the same as the version used at runtime. The kludge is
definitely questionable and untested!
> Compiled schema cannot find symbol readFieldOrderIfDiff (Java)
> --------------------------------------------------------------
>
> Key: AVRO-2682
> URL: https://issues.apache.org/jira/browse/AVRO-2682
> Project: Apache Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.9.0, 1.10.0, 1.9.1, 1.9.2
> Environment: OS: MacOS 10.15.2
> IDE: IntelliJ 2019.3.1 with Java9
> Avro compiler: avro-tools 1.9.1
> Libraries (via Maven): org.apache.avro:avro:1.9.1 and
> org.apache.avro:avro-maven-plugin:1.9.1 (though several other versions have
> been tested as well)
> Reporter: Kevin A Shaw
> Priority: Blocker
> Attachments: ActivityRecord2.avsc, ResolvingDecoder.java,
> SpecificRecordBase.java, Test.java, Untitled.png
>
>
> We are experimenting with Avro to generate data files for a large data repo
> we are building.
> Hence, we created a small test Avro Schema (see attached
> `ActivityRecord2.avsc`). We compiled it with `avro-tools` using the
> following command:
> {{avro-tools compile schema ActivityRecord2.avsc ~/foobar/src/main/java}}
> The resulting file, `Test.java` (attached) will not compile in IntelliJ with
> Java9.
> There are four messages (a screen shot of the source with highlighting is
> attached: `Untitled.jpg`).
> The errors are:
>
> {code:java}
> Error:(279, 3) java: method does not override or implement a method from a
> supertype
> Error:(281, 3) java: method does not override or implement a method from a
> supertype
> Error:(288, 3) java: method does not override or implement a method from a
> supertype
> Error:(291, 51) java: cannot find symbol
> symbol: method readFieldOrderIfDiff()
> location: variable in of type org.apache.avro.io.ResolvingDecoder
> {code}
> I have inspected the source for these to classes (ResolvingDecoder and
> SpecificRecordBase), decompiled them from the Avro .jar library and stored
> the resulting java source. These two files are attached and they definitely
> do not have the required symbols present. These are from the 1.9.1 release.
> I have used Maven to test several versions of the Jar Libraries (as listed
> above), including Avro 1.8, 1.9 and 1.10, but with no improvements. I get
> the same error for all of them.
> Is there something that we are going wrong here?
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)