[
https://issues.apache.org/jira/browse/AVRO-2682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17017926#comment-17017926
]
Ryan Skraba commented on AVRO-2682:
-----------------------------------
!artifact-deps.png|width=596,height=181!
Ah, I think I see. It's likely that your manual installation of avro:1.9.1 in
IntelliJ is being overridden by some other maven artifact importing 1.8.2! For
example:
Unfortunately, this can happen when you manually install Maven artifacts. You
can check by deleting the {{org.apache.avro:avro:1.9.1}} library (the one that
you explicitly installed), and seeing whether the Avro classes are still
available anyway. Normally when you navigate to a decompiled .class file like
org.apache.avro.Schema, you can see the library version in the title bar.
I usually use IntelliJ but specify my projects with maven's {{pom.xml}} and
import it. IntelliJ is quite good for keeping the IDE in sync with the pom, and
you can use maven tools for checking where dependencies are being added.
In your case, it depends on what artifact is importing 1.8.2 – you might be
able to override it with 1.9.1 and use the avro-tools-1.9.1.jar, or you might
need to use avro-tools-1.8.2.jar to generate your code if it can't be bumped.
If you can confirm that some other artifact is importing 1.8.2, we can probably
close this bug.
> 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.9.1
> 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
> Fix For: 1.9.2
>
> Attachments: ActivityRecord2.avsc, IntelliJ Avro Library.png,
> ResolvingDecoder.java, SpecificRecordBase.java, Test.java, Untitled.png,
> artifact-deps.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)