You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/08/29 12:27:50 UTC

[GitHub] [flink] lsyldliu opened a new pull request, #20707: [FLINK-29074][Connectors/JDBC] Fix ClassNotFound exception when using jdbc connector by add jar syntax

lsyldliu opened a new pull request, #20707:
URL: https://github.com/apache/flink/pull/20707

   ## What is the purpose of the change
   
   *Since [FLINK-15635](https://issues.apache.org/jira/browse/FLINK-15635), in order to solve the class conflict problem, we introduce a user classloader in the table module, this classloader focus on loading the user class. So if the connector is added to TableEnvironment by add jar syntax, the class load behavior in the connector should also use the user classloader, otherwise, maybe occur ClassNotFound exception.*
   
   
   ## Brief change log
   
   Using the user classloader load some classes in JDBC connector.
   
   
   ## Verifying this change
   
   Manually verified the changes.
   
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? ( no)
     - If yes, how is the feature documented? (not documented)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] lsyldliu commented on pull request #20707: [FLINK-29074][Connectors/JDBC] Fix ClassNotFound exception when using jdbc connector by add jar syntax

Posted by GitBox <gi...@apache.org>.
lsyldliu commented on PR #20707:
URL: https://github.com/apache/flink/pull/20707#issuecomment-1230220878

   cc @leonardBang, @PatrickRen 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] wuchong merged pull request #20707: [FLINK-29074][Connectors/JDBC] Fix ClassNotFound exception when using jdbc connector by add jar syntax

Posted by GitBox <gi...@apache.org>.
wuchong merged PR #20707:
URL: https://github.com/apache/flink/pull/20707


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] flinkbot commented on pull request #20707: [FLINK-29074][Connectors/JDBC] Fix ClassNotFound exception when using jdbc connector by add jar syntax

Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #20707:
URL: https://github.com/apache/flink/pull/20707#issuecomment-1230226355

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "81a27ce899cf6a57d56b7a35234d07abde98ef9a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "81a27ce899cf6a57d56b7a35234d07abde98ef9a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 81a27ce899cf6a57d56b7a35234d07abde98ef9a UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] wuchong commented on a diff in pull request #20707: [FLINK-29074][Connectors/JDBC] Fix ClassNotFound exception when using jdbc connector by add jar syntax

Posted by GitBox <gi...@apache.org>.
wuchong commented on code in PR #20707:
URL: https://github.com/apache/flink/pull/20707#discussion_r963524735


##########
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/catalog/JdbcCatalog.java:
##########
@@ -41,16 +41,17 @@ public class JdbcCatalog extends AbstractJdbcCatalog {
     private final AbstractJdbcCatalog internal;
 
     public JdbcCatalog(
+            ClassLoader userClassLoader,

Review Comment:
   I'm afraid we can't modify the constructor because `JdbcCatalog` is annotated as `@PublicEvolving`. Can you add another constructor and deprecate the existing one?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] lsyldliu commented on pull request #20707: [FLINK-29074][Connectors/JDBC] Fix ClassNotFound exception when using jdbc connector by add jar syntax

Posted by GitBox <gi...@apache.org>.
lsyldliu commented on PR #20707:
URL: https://github.com/apache/flink/pull/20707#issuecomment-1236711791

   Spark: https://github.com/apache/spark/pull/5543/files


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org