Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apache Beam Java Lib and ANTLR #32696

Open
pinfrederic opened this issue Oct 8, 2024 · 2 comments · Fixed by #33016
Open

Apache Beam Java Lib and ANTLR #32696

pinfrederic opened this issue Oct 8, 2024 · 2 comments · Fixed by #33016

Comments

@pinfrederic
Copy link

I am using Apache Beam with Google Dataflow in Java and I am trying to migrate the java lib from v2.51.0 to v2.59.0

We are using ANTLR v4.11.1 as a dependency of our Beam Pipeline.

With the v2.59.0 the pipeline fails to start with the error
ANTLR Tool version 4.7 used for code generation does not match the current runtime version 4.11.1

I can see both Apache Beam v2.51.0 and v2.59.0 are compiled with ANTLR v4.7 as a dependency HERE and HERE

My questions are the following:
Why do I suddenly get an exception at runtime with v2.59.0 when the v2.51.0 was working correctly?
I am not very confident to downgrade our version of ANTLR just because Apache Beam uses the v4.7. What if you upgrade it to v4.13? I would need to adapt again... this problem can be met by a lot of users of Apache Beam, is it possible to get rid of this dependency on Apache Beam lib?

@ygw
Copy link

ygw commented Nov 4, 2024

We are running into a similar issue where we have a 4.13 dependency elsewhere in our codebase, and now 4.7 through Beam. Can Beam upgrade to 4.13?

idan-at pushed a commit to idan-at/beam that referenced this issue Nov 5, 2024
To allow users of newer versions of antlr, that
cannot downgrade, to use apache-beam.

Fixes apache#32696
@Abacn
Copy link
Contributor

Abacn commented Nov 5, 2024

I'm trying to understand the use case. Beam Java core should have repackaged antlr core and antlr runtime and shaded in the released jar. Inspect the beam-sdks-java-core jar, org.antlr.v4 classes are directed to org.apache.beam.repackaged.core.org.antlr.v4 namespace.

User program should be able to use newer antlr version. You can exclude antlr in your project, e.g.

implementation('org.apache.beam:beam-sdks-java-core:2.60.0') {
        exclude group: 'org.antlr', module: '*'
    }

@Abacn Abacn closed this as completed in 9baa7ba Nov 5, 2024
@github-actions github-actions bot added this to the 2.61.0 Release milestone Nov 5, 2024
@Abacn Abacn reopened this Nov 6, 2024
@damccorm damccorm removed this from the 2.61.0 Release milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants