Open ShimaLeo opened 5 months ago
参考其他的reader里的pom文件试试?
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>${fastjson-version}</version>
</dependency>
自己开发插件要按照插件开发宝典来开发,然后再打包的。 你仅仅是上传一个jar包,是确实一些依赖的。 因为插件打包好后会在plugin的reader或者writer目录下,且插件时一个单独的目录,插件的依赖在插件目录下的lib目录。你观察一下官方打包的目录结构。 最后,一定是要通过打包命令去打包然后部署,而不仅仅是上传一个jar包就可以正确运行的。
Exception in thread "taskGroup-0" com.alibaba.datax.common.exception.DataXException: Code:[Framework-13], Description:[DataX插件运行时出错, 具体原因请参看DataX运行结束时的错误诊断信息 .]. - java.lang.NoClassDefFoundError: com/alibaba/fastjson2/JSON at com.alibaba.datax.plugin.reader.mongodbreader.MongoDBReader$Task.init(MongoDBReader.java:200) at com.alibaba.datax.core.taskgroup.runner.ReaderRunner.run(ReaderRunner.java:45) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassNotFoundException: com.alibaba.fastjson2.JSON at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 3 more
java.lang.NoClassDefFoundError: com/alibaba/fastjson2/JSON at com.alibaba.datax.plugin.reader.mongodbreader.MongoDBReader$Task.init(MongoDBReader.java:200) at com.alibaba.datax.core.taskgroup.runner.ReaderRunner.run(ReaderRunner.java:45) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassNotFoundException: com.alibaba.fastjson2.JSON at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 3 more
at com.alibaba.datax.common.exception.DataXException.asDataXException(DataXException.java:48) at com.alibaba.datax.core.taskgroup.TaskGroupContainer.start(TaskGroupContainer.java:195) at com.alibaba.datax.core.taskgroup.runner.TaskGroupContainerRunner.run(TaskGroupContainerRunner.java:24) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NoClassDefFoundError: com/alibaba/fastjson2/JSON at com.alibaba.datax.plugin.reader.mongodbreader.MongoDBReader$Task.init(MongoDBReader.java:200) at com.alibaba.datax.core.taskgroup.runner.ReaderRunner.run(ReaderRunner.java:45) ... 1 more Caused by: java.lang.ClassNotFoundException: com.alibaba.fastjson2.JSON at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 3 more 自定义mongodbreader,打包上传mongodbreader-0.0.1-SNAPSHOT.jar后,运行报错,在mongodbreader的pom文件中添加fastjson2依赖后再次打包上传仍然报错