Flink (1.12) Beam (2.30) word count example missing a dependency for the uber jar
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 196
Description
https://beam.apache.org/documentation/runners/flink/#flink-version-compatibility
The word count example generated by the `mvn archetype` command is missing a dependency to run successfully with Flink.
```
com.fasterxml.jackson.module
jackson-module-jaxb-annotations
2.12.4
```
This won't become apparent until one tries to run the packaged uber jar in a Flink cluster (1.12 in my case) and gets the following error:
```
tianzi@tz-yarn-m:~$ flink run -c org.apache.beam.examples.WordCount word-count-beam-bundled-0.1.jar
--runner=FlinkRunner
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/lib/flink/lib/log4j-slf4j-impl-2.12.1.jar!/org/slf4j/impl/StaticL
oggerBinder.class]
SLF4J:
Found binding in [jar:file:/usr/lib/hadoop/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLog
gerBinder.class]
SLF4J:
See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is
of type [org.apache.logging.slf4j.Log4jLoggerFactory]
2021-07-09 16:45:28,061 INFO org.apache.flink.yarn.cli.FlinkYarnSessionCli
[] - Found Ya
rn properties file under /tmp/.yarn-properties-tianzi.
2021-07-09 16:45:28,061
INFO org.apache.flink.yarn.cli.FlinkYarnSessionCli [] - Found Ya
rn properties file
under /tmp/.yarn-properties-tianzi.
java.util.ServiceConfigurationError: com.fasterxml.jackson.databind.Module:
Provider com.fasterxml.jacks
on.module.jaxb.JaxbAnnotationModule not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at com.fasterxml.jackson.databind.ObjectMapper.findModules(ObjectMapper.java:1081)
at
org.apache.beam.sdk.options.PipelineOptionsFactory.(PipelineOptionsFactory.java:478)
at org.apache.beam.examples.WordCount.main(WordCount.java:196)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:349)
at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedPro
gram.java:219)
at org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:114)
at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:812)
at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:246)
at org.apache.flink.client.cli.CliFrontend.parseAndRun(CliFrontend.java:1054)
at org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:1132)
at
java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1762)
at org.apache.flink.runtime.security.contexts.HadoopSecurityContext.runSecured(HadoopSecurityCon
text.java:41)
at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1132)
```
Imported from Jira [BEAM-12595](https://issues.apache.org/jira/browse/BEAM-12595). Original Jira may contain additional context.
Reported by: tianzi.
Contributor guide
Research direction
Start with the Maven archetype's generated WordCount project and its uber-jar dependency list; the reported failure reaches WordCount.java:196 and PipelineOptionsFactory. Reproduce the packaged-jar run with the Flink 1.12 and Beam 2.30 combination, then verify that the reported Jackson service-configuration error no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100