WeiYe-Jing / datax-web

DataX集成可视化页面,选择数据源即可一键生成数据同步任务,支持RDBMS、Hive、HBase、ClickHouse、MongoDB等数据源,批量创建RDBMS数据同步任务,集成开源调度系统,支持分布式、增量同步数据、实时查看运行日志、监控执行器资源、KILL运行进程、数据源信息加密等。
https://segmentfault.com/u/weiye_jing/articles
MIT License
5.64k stars 2.17k forks source link

错误: 找不到或无法加载主类 com.alibaba.datax.core.Engine #492

Open Bryanquan opened 3 years ago

Bryanquan commented 3 years ago

本地部署datax-web项目,运行mysql到mysql的同步任务报错,错误日志如下,大神们帮忙解决下

错误: 找不到或无法加载主类 com.alibaba.datax.core.Engine

FuYouJ commented 1 year ago

这个是因为你指定的目录是源码java目录 而不是编译后的target二进制目录

yun81911 commented 9 months ago

我也是类似的问题,大神有解决么? [root@iZbp11ckqr22wit1wujz1kZ datax-python3]# python /root/datax-web/doc/datax-web/datax-python3/datax.py test.job

DataX (DATAX-OPENSOURCE-3.0), From Alibaba ! Copyright (C) 2010-2017, Alibaba Group. All Rights Reserved.

Error: Could not find or load main class com.alibaba.datax.core.Engine

FuYouJ commented 9 months ago

我也是类似的问题,大神有解决么? [root@iZbp11ckqr22wit1wujz1kZ datax-python3]# python /root/datax-web/doc/datax-web/datax-python3/datax.py test.job

DataX (DATAX-OPENSOURCE-3.0), From Alibaba ! Copyright (C) 2010-2017, Alibaba Group. All Rights Reserved.

Error: Could not find or load main class com.alibaba.datax.core.Engine

你是不是下载的代码 而不是 打包后的代码?

yun81911 commented 9 months ago

是的,我是参考https://github.com/WeiYe-Jing/datax-web/blob/master/doc/datax-web/datax-web-deploy.md 自己mvn clean install 编译打包后解压、再在/root/datax-web/build/datax-web-2.1.2/下面执行的start-all.sh

我是在build/datax-web-2.1.2下面执行的 [root@iZbp11ckqr22wit1wujz1kZ datax-web]# tree -L 2 . ├── bin │ ├── db │ ├── install.sh │ ├── start-all.sh │ ├── start.sh │ ├── stop-all.sh │ └── stop.sh ├── build │ ├── datax-web-2.1.2 │ └── datax-web-2.1.2.tar.gz ├── datax-admin │ ├── pom.xml │ ├── src │ └── target ├── datax-assembly │ ├── package.xml │ ├── pom.xml │ └── target ├── datax-core │ ├── pom.xml │ ├── src │ └── target ├── datax-executor │ ├── pom.xml │ ├── src │ └── target ├── datax-rpc │ ├── pom.xml │ ├── src │ └── target ├── doc │ └── datax-web ├── LICENSE ├── packages │ ├── datax-admin_2.1.2_1.tar.gz │ └── datax-executor_2.1.2_1.tar.gz ├── pom.xml

yun81911 commented 9 months ago

我的datax.py 是在/root/datax-web/doc/datax-web/datax-python3/datax.py目录有,单独执行报错,是要手动复制到什么目录么?

手动执行命令也报相同的错误

python /root/datax-web/doc/datax-web/datax-python3/datax.py test.job DataX (DATAX-OPENSOURCE-3.0), From Alibaba ! Copyright (C) 2010-2017, Alibaba Group. All Rights Reserved. Error: Could not find or load main class com.alibaba.datax.core.Engine

FuYouJ commented 9 months ago

我的datax.py 是在/root/datax-web/doc/datax-web/datax-python3/datax.py目录有,单独执行报错,是要手动复制到什么目录么?

手动执行命令也报相同的错误

python /root/datax-web/doc/datax-web/datax-python3/datax.py test.job DataX (DATAX-OPENSOURCE-3.0), From Alibaba ! Copyright (C) 2010-2017, Alibaba Group. All Rights Reserved. Error: Could not find or load main class com.alibaba.datax.core.Engine

web执行就不会使用命令行了,需要按照web项目的指示把目录配置好