[ https://issues.apache.org/jira/browse/FLINK-35064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17837068#comment-17837068 ]
Yufan Sheng commented on FLINK-35064: ------------------------------------- I have made a comment in the related PR. I just copy/paste it here for reference. The {{pulsar-client-all}} bundle its Jackson internally with a package named {{org.apache.pulsar.shade.com.fasterxml}}. The jackson used in flink shouldn't be shaded into the same package name. Or it may cause more severe issues in class conflicting. I don't think this is a good idea. The root cause is from pulsar client side with the Jackson shading issues. Shade a jackson causes a lot of issues in developing and running the flink-sql-connector-pulsar before we (StreamNative) donate it to flink community. I think we should ask pulsar do not shade the {{jackson-annotation}} in client for fixing this problem. > Flink sql connector pulsar/hive > com.fasterxml.jackson.annotation.JsonFormat$Value conflict > ------------------------------------------------------------------------------------------ > > Key: FLINK-35064 > URL: https://issues.apache.org/jira/browse/FLINK-35064 > Project: Flink > Issue Type: Bug > Components: Connectors / Hive, Connectors / Pulsar > Affects Versions: 1.16.1 > Reporter: elon_X > Priority: Major > Labels: pull-request-available > > When I compile and package {{flink-sql-connector-pulsar}} & > {{{}flink-sql-connector-hive{}}}, and then put these two jar files into the > Flink lib directory, I execute the following SQL statement through > {{{}bin/sql-client.sh{}}}: > > {code:java} > // code placeholder > CREATE TABLE > pulsar_table ( > content string, > proc_time AS PROCTIME () > ) > WITH > ( > 'connector' = 'pulsar', > 'topics' = 'persistent://xxx', > 'service-url' = 'pulsar://xxx', > 'source.subscription-name' = 'xxx', > 'source.start.message-id' = 'latest', > 'format' = 'csv', > 'pulsar.client.authPluginClassName' = > 'org.apache.pulsar.client.impl.auth.AuthenticationToken', > 'pulsar.client.authParams' = 'token:xxx' > ); > > select * from pulsar_table; {code} > The task error exception stack is as follows: > > {code:java} > Caused by: java.lang.NoSuchMethodError: > com.fasterxml.jackson.annotation.JsonFormat$Value.empty()Lcom/fasterxml/jackson/annotation/JsonFormat$Value; > at > org.apache.pulsar.shade.com.fasterxml.jackson.databind.cfg.MapperConfig.<clinit>(MapperConfig.java:56) > ~[flink-sql-connector-pulsar-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at > org.apache.pulsar.shade.com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:660) > ~[flink-sql-connector-pulsar-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at > org.apache.pulsar.shade.com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:576) > ~[flink-sql-connector-pulsar-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at > org.apache.pulsar.common.util.ObjectMapperFactory.createObjectMapperInstance(ObjectMapperFactory.java:151) > ~[flink-sql-connector-pulsar-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at > org.apache.pulsar.common.util.ObjectMapperFactory.<clinit>(ObjectMapperFactory.java:142) > ~[flink-sql-connector-pulsar-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at > org.apache.pulsar.client.impl.conf.ConfigurationDataUtils.create(ConfigurationDataUtils.java:35) > ~[flink-sql-connector-pulsar-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at > org.apache.pulsar.client.impl.conf.ConfigurationDataUtils.<clinit>(ConfigurationDataUtils.java:43) > ~[flink-sql-connector-pulsar-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at > org.apache.pulsar.client.impl.ClientBuilderImpl.loadConf(ClientBuilderImpl.java:77) > ~[flink-sql-connector-pulsar-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at > org.apache.flink.connector.pulsar.common.config.PulsarClientFactory.createClient(PulsarClientFactory.java:105) > ~[flink-sql-connector-pulsar-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at > org.apache.flink.connector.pulsar.source.enumerator.PulsarSourceEnumerator.<init>(PulsarSourceEnumerator.java:95) > ~[flink-sql-connector-pulsar-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at > org.apache.flink.connector.pulsar.source.enumerator.PulsarSourceEnumerator.<init>(PulsarSourceEnumerator.java:76) > ~[flink-sql-connector-pulsar-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at > org.apache.flink.connector.pulsar.source.PulsarSource.createEnumerator(PulsarSource.java:144) > ~[flink-sql-connector-pulsar-4.0-SNAPSHOT.jar:4.0-SNAPSHOT] at > org.apache.flink.runtime.source.coordinator.SourceCoordinator.start(SourceCoordinator.java:213) > ~[flink-dist_2.12-1.16.1.jar:1.16.1] > {code} > > The exception shows a conflict with > {{{}com.fasterxml.jackson.annotation.JsonFormat$Value{}}}. I investigated and > found that {{flink-sql-connector-pulsar}} and {{flink-sql-connector-hive}} > depend on different versions, leading to this conflict. > {code:java} > // flink-sql-connector-pulsar pom.xml > <dependency> > <groupId>com.fasterxml.jackson</groupId> > <artifactId>jackson-bom</artifactId> > <type>pom</type> > <scope>import</scope> > <version>2.13.4.20221013</version> > </dependency> > // flink-sql-connector-hive pom.xml > <dependency> > <groupId>com.fasterxml.jackson</groupId> > <artifactId>jackson-bom</artifactId> > <type>pom</type> > <scope>import</scope> > <version>2.15.3</version> > </dependency>{code} > -- This message was sent by Atlassian Jira (v8.20.10#820010)