You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/09/24 05:29:36 UTC

[GitHub] [incubator-seatunnel] liugddx opened a new issue, #2873: [Bug] [seatunnel-examples] run jdbc task will error

liugddx opened a new issue, #2873:
URL: https://github.com/apache/incubator-seatunnel/issues/2873

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
   
   
   ### What happened
   
   run jdbc task in example will error,so i improved the following document.
   
   the error is `Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.MysqlXADataSource`
   
   
   ### SeaTunnel Version
   
   dev
   
   ### SeaTunnel Config
   
   ```conf
   #
   # Licensed to the Apache Software Foundation (ASF) under one or more
   # contributor license agreements.  See the NOTICE file distributed with
   # this work for additional information regarding copyright ownership.
   # The ASF licenses this file to You under the Apache License, Version 2.0
   # (the "License"); you may not use this file except in compliance with
   # the License.  You may obtain a copy of the License at
   #
   #    http://www.apache.org/licenses/LICENSE-2.0
   #
   # Unless required by applicable law or agreed to in writing, software
   # distributed under the License is distributed on an "AS IS" BASIS,
   # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   # See the License for the specific language governing permissions and
   # limitations under the License.
   #
   ######
   ###### This config file is a demonstration of streaming processing in seatunnel config
   ######
   
   env {
     # You can set flink configuration here
     execution.parallelism = 1
     #job.mode = "BATCH"
     #execution.checkpoint.interval = 10000
     #execution.checkpoint.data-uri = "hdfs://localhost:9000/checkpoint"
   }
   
   source {
     # This is a example source plugin **only for test and demonstrate the feature source plugin**
       FakeSource {
         result_table_name = "fake"
         schema = {
           fields {
             name = "string"
             age = "int"
           }
         }
       }
   
     # If you would like to get more information about how to configure seatunnel and see full list of source plugins,
     # please go to https://seatunnel.apache.org/docs/category/source-v2
   }
   
   transform {
       sql {
         sql = "select name,age from fake"
       }
   
     # If you would like to get more information about how to configure seatunnel and see full list of transform plugins,
     # please go to https://seatunnel.apache.org/docs/category/transform
   }
   
   sink {
     Jdbc {
       url = "jdbc:mysql://localhost:3306/test"
       driver = "com.mysql.cj.jdbc.Driver"
   
       max_retries = 0
       user = "root"
       password = "root"
       query = "insert into fake(name,age) values(?,?)"
   
       is_exactly_once = "true"
   
       xa_data_source_class_name = "com.mysql.cj.jdbc.MysqlXADataSource"
     }
   
     # If you would like to get more information about how to configure seatunnel and see full list of sink plugins,
     # please go to https://seatunnel.apache.org/docs/category/sink-v2
   }
   ```
   
   
   ### Running Command
   
   ```shell
   local example.
   ```
   
   
   ### Error Exception
   
   ```log
   Caused by: java.sql.SQLException: java.lang.RuntimeException: Failed to load [com.mysql.cj.jdbc.MysqlXADataSource]
   	at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.xa.XaFacadeImplAutoLoad.open(XaFacadeImplAutoLoad.java:94)
   	at org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcExactlyOnceSinkWriter.tryOpen(JdbcExactlyOnceSinkWriter.java:105)
   	... 43 more
   Caused by: java.lang.RuntimeException: Failed to load [com.mysql.cj.jdbc.MysqlXADataSource]
   	at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.connection.DataSourceUtils.loadDataSource(DataSourceUtils.java:95)
   	at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.connection.DataSourceUtils.buildCommonDataSource(DataSourceUtils.java:44)
   	at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.xa.XaFacadeImplAutoLoad.open(XaFacadeImplAutoLoad.java:91)
   	... 44 more
   Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.MysqlXADataSource
   	at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
   	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
   	at java.lang.Class.forName0(Native Method)
   	at java.lang.Class.forName(Class.java:264)
   	at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.connection.DataSourceUtils.loadDataSource(DataSourceUtils.java:93)
   	... 46 more
   ```
   
   
   ### Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   _No response_
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscribe@seatunnel.apache.org.apache.org

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


[GitHub] [incubator-seatunnel] liugddx commented on issue #2873: [Bug] [seatunnel-examples] run jdbc task will error

Posted by GitBox <gi...@apache.org>.
liugddx commented on issue #2873:
URL: https://github.com/apache/incubator-seatunnel/issues/2873#issuecomment-1256867571

   #2800 


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] TyrantLucifer closed issue #2873: [Bug] [seatunnel-examples] run jdbc task will error in examples

Posted by GitBox <gi...@apache.org>.
TyrantLucifer closed issue #2873: [Bug] [seatunnel-examples] run jdbc task will error in examples
URL: https://github.com/apache/incubator-seatunnel/issues/2873


-- 
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: commits-unsubscribe@seatunnel.apache.org

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