[ https://issues.apache.org/jira/browse/FLINK-34472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17818814#comment-17818814 ]
jeremyMu commented on FLINK-34472: ---------------------------------- It's the same problem > loading class of protobuf format descriptor by "Class.forName(className, > true, Thread.currentThread().getContextClassLoader())" may can not find class > because the current thread class loader may not contain this class > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: FLINK-34472 > URL: https://issues.apache.org/jira/browse/FLINK-34472 > Project: Flink > Issue Type: Bug > Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile) > Affects Versions: 1.16.2, 1.18.1 > Reporter: jeremyMu > Priority: Minor > Fix For: 1.20.0 > > Attachments: exception1.png, sourcecode.jpg, sourcecode2.png, > sourcecode3.png > > Original Estimate: 336h > Remaining Estimate: 336h > > 1、Stack information: > Caused by: java.lang.IllegalArgumentException: get test.ProtobufTest1 > descriptors error! > at > org.apache.flink.formats.protobuf.util.PbFormatUtils.getDescriptor(PbFormatUtils.java:94) > at > org.apache.flink.formats.protobuf.serialize.PbRowDataSerializationSchema.<init>(PbRowDataSerializationSchema.java:49) > at > org.apache.flink.formats.protobuf.PbEncodingFormat.createRuntimeEncoder(PbEncodingFormat.java:47) > at > org.apache.flink.formats.protobuf.PbEncodingFormat.createRuntimeEncoder(PbEncodingFormat.java:31) > at > org.apache.flink.streaming.connectors.kafka.table.KafkaDynamicSink.createSerialization(KafkaDynamicSink.java:388) > at > org.apache.flink.streaming.connectors.kafka.table.KafkaDynamicSink.getSinkRuntimeProvider(KafkaDynamicSink.java:194) > at > org.apache.flink.table.planner.plan.nodes.exec.common.CommonExecSink.createSinkTransformation(CommonExecSink.java:150) > at > org.apache.flink.table.planner.plan.nodes.exec.stream.StreamExecSink.translateToPlanInternal(StreamExecSink.java:176) > at > org.apache.flink.table.planner.plan.nodes.exec.ExecNodeBase.translateToPlan(ExecNodeBase.java:159) > at > org.apache.flink.table.planner.delegation.StreamPlanner.$anonfun$translateToPlan$1(StreamPlanner.scala:85) > at > scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233) > at scala.collection.Iterator.foreach(Iterator.scala:937) > at scala.collection.Iterator.foreach$(Iterator.scala:937) > at scala.collection.AbstractIterator.foreach(Iterator.scala:1425) > at scala.collection.IterableLike.foreach(IterableLike.scala:70) > at scala.collection.IterableLike.foreach$(IterableLike.scala:69) > at scala.collection.AbstractIterable.foreach(Iterable.scala:54) > at scala.collection.TraversableLike.map(TraversableLike.scala:233) > at scala.collection.TraversableLike.map$(TraversableLike.scala:226) > at scala.collection.AbstractTraversable.map(Traversable.scala:104) > 2、my suggestion: > Add a member variable to PbEncodingFormat: class loader instance, which is > passed through DynamicTableFactory.Context method :getClassLoader() -- This message was sent by Atlassian Jira (v8.20.10#820010)