首页 > 其他分享 >【Flink系列十八】Hudi hive_sync JDO报错 Could not find API definition for name "JDO"

【Flink系列十八】Hudi hive_sync JDO报错 Could not find API definition for name "JDO"

时间:2024-10-10 17:37:07浏览次数:1  
标签:definition JDO java jar datanucleus 0.14 api 报错 hudi

问题现象

Error : Could not find API definition for name "JDO". Perhaps you dont have the requisite datanucleus-api-XXX jar in the CLASSPATH?

2024-10-10 11:12:31,251 ERROR DataNucleus.Persistence                                      [] - Error : Could not find API definition for name "JDO". Perhaps you dont have the requisite datanucleus-api-XXX jar in the CLASSPATH?
Caused by: org.datanucleus.exceptions.NucleusUserException: Error : Could not find API definition for name "JDO". Perhaps you dont have the requisite datanucleus-api-XXX jar in the CLASSPATH?
	at org.datanucleus.api.ApiAdapterFactory.getApiAdapter(ApiAdapterFactory.java:93) ~[hudi-flink-bundle-1.17.1-0.14.3-slankka.jar:0.14.0]
	at org.datanucleus.AbstractNucleusContext.<init>(AbstractNucleusContext.java:118) ~[hudi-flink-bundle-1.17.1-0.14.3-slankka.jar:0.14.0]
	at org.datanucleus.PersistenceNucleusContextImpl.<init>(PersistenceNucleusContextImpl.java:170) ~[hudi-flink-bundle-1.17.1-0.14.3-slankka.jar:0.14.0]
	at org.datanucleus.PersistenceNucleusContextImpl.<init>(PersistenceNucleusContextImpl.java:159) ~[hudi-flink-bundle-1.17.1-0.14.3-slankka.jar:0.14.0]
	at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.<init>(JDOPersistenceManagerFactory.java:433) ~[hudi-flink-bundle-1.17.1-0.14.3-slankka.jar:0.14.0]
	at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:311) ~[hudi-flink-bundle-1.17.1-0.14.3-slankka.jar:0.14.0]
	at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:220) ~[hudi-flink-bundle-1.17.1-0.14.3-slankka.jar:0.14.0]
	at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_351]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_351]
	at javax.jdo.JDOHelper$16.run(JDOHelper.java:1965) ~[hudi-flink-bundle-1.17.1-0.14.3-slankka.jar:0.14.0]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_351]
	at javax.jdo.JDOHelper.invoke(JDOHelper.java:1960) ~[hudi-flink-bundle-1.17.1-0.14.3-slankka.jar:0.14.0]
	at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1166) ~[hudi-flink-bundle-1.17.1-0.14.3-slankka.jar:0.14.0]
	... 53 more

问题分析

Could not find API definition for name "JDO",直接查找hudi源码

位置:org.datanucleus.api.ApiAdapterFactory#getApiAdapter

api = (ApiAdapter) pluginMgr.createExecutableExtension("org.datanucleus.api_adapter", "name", 
                    name, "class-name", null, null);
                if (api == null)
                {
                    String msg = Localiser.msg("022001", name);
                    NucleusLogger.PERSISTENCE.error(msg);
                    throw new NucleusUserException(msg);
                }

显然是插件加载机制,找不到 org.datanucleus.api_adapter 名为 JDO的一个插件

所在位置 datanucleus-api-jdo-3.2.6.jar!\plugin.xml

    <extension point="org.datanucleus.api_adapter">
        <api-adapter name="JDO" class-name="org.datanucleus.api.jdo.JDOAdapter"/>
    </extension>

一看是配置文件,那么马上想到是打包的问题,检查发现,果然如此,是上述 hudi-flink-bundle-1.17.1-0.14.3-slankka.jar 所致。

shade打包,一般我们会特殊处理 META-INF下的services等。这类软件包的配置文件比较特殊。因此很可能没有特殊处理,因此 shade 会将同名文件随机互相覆盖。

  • datanucleus-api-jdo-4.2.4.jar
  • datanucleus-core-4.1.17.jar
  • datanucleus-rdbms-4.1.19.jar

经过网络搜索发现 shade 插件打包不容易做到 merge xml文件。因此国际互联网上的解决方法是合并成一个 plugin.xml

解决方案

  1. 要么放弃这种 shade 为一个独立的 jar,单独引入 上述datanucleus-api-jdo 等软件包
  2. 要么 shade的时候,再维护一份合并好的 plugin.xml

标签:definition,JDO,java,jar,datanucleus,0.14,api,报错,hudi
From: https://www.cnblogs.com/slankka/p/18456814

相关文章

  • ant-design 使用Modal组件报错问题记录
    打开modal组件会提示如下报错信息高版本chrome浏览器会出现这个问题 原因是:不能在获得焦点的元素或其祖先上使用aria-hidden解决方案:全局添加如下CSS,暂时将Modal中该属性的元素隐藏掉.ant-modaldiv[aria-hidden="true"]{display:none!important;} ......
  • import mindnlp报错:OSError: cannot load library ‘libsndfile.so‘: libsndfile.so:
    在启智平台AI调试环境下,安装mindnlp后,importmindnlp报错。安装mindnlp命令:#安装mindnlp的daily包,待正式发布后可改为直接安装mindnlp包!pipinstallhttps://mindspore-courses.obs.cn-north-4.myhuaweicloud.com/mindnlp/mindnlp-0.4.0-py3-none-any.whl-ihttps://pypi.......
  • 浏览器报错 | 代理服务器可能有问题,或地址不正确
    问题描述Windows连网情况下,浏览器访问地址显示“你尚未连接,代理服务器可能有问题,或地址不正确。”解决方法电脑右下侧的WiFi图标右键,打开网络和Internet设置打开代理打开自动设置代理的“自动检测设置”关闭手动设置代理的“使用代理服务器”这样就可以正......
  • HarmonyOS开发——编译报错“The reason and usedScene attributes are mandatory for
    问题现象:DevEcoStudio编译失败,提示“ThereasonandusedSceneattributesaremandatoryforuser_grantpermissions”。问题原因:从DevEcoStudioNEXTDeveloperPreview2版本开始新增规则:APP包中,所有entry和featurehap的module下的requestPermissions权限清单必须指定(......
  • 自动化测试 | 安装selenium教程以及(ERROR: pip‘s dependency resolver does not cur
    1.在cmd里面安装selenium输入:pipinstallselenium在我这里出现了下载缓慢的问题,一直卡了半天,有同样问题的小伙伴可以试试输入下面这个进行安装,会更快一点:pip--default-timeout=100installselenium-ihttps://pypi.tuna.tsinghua.edu.cn/simple之后仍然出现了:ERRO......
  • codeforces round 974(div.3)E(优先队列实现dijstra算法,devc++的优先队列用greater报
    解题历程:看到两边同时移动,计算最终的相遇时间,我就想到两边同时计算各点到起点的最短距离,就是使用dijstra算法,最后所有节点取两次计算的最大值,再对所有节点取最小值,就是最终答案了,可是这个思路没有考虑有马的情况,思考一番后发现可以多列一个数组记录有马的情况下的行走最短路,然后......
  • Vscode中的行尾序列CRLF/LF问题,及其引起的Delete ‘␍‘ 的报错问题
    本人使用的是Windows系统,Unix/Linux/macOS系统也可参照此方法解决问题报错如图:(如果你只想解决报错的话直接下翻到解决方法,想了解原理的话请耐心看完)在这之前,我们先来了解一下什么是行尾符(也叫换行符/行尾序列)。行尾符是用于标记文本文件中一行结束的字符,不同的操作系统使......
  • 运行CtsVerifier.apk报错
    要过GMS认证,遇到个问题。安装CtsVerifier.apk。前面几个选项都OK。可以测试成功。执行CameraITSTest的时候崩溃。查看log:r:AccessinghiddenmethodLandroid/hardware/devicestate/DeviceStateManager;->getSupportedStates()[I(blocked,test-api,linking,denied......
  • 停止训练后报错torch.cuda.OutOfMemoryError: CUDA out of memory. 及查看进程和停止
    停止训练后遇到 torch.cuda.OutOfMemoryError 错误,意味着你的GPU内存不足,无法分配更多内存给当前的PyTorch操作。查看进程并关闭相关进程就可恢复。在不同的操作系统中,查看进程的方法有所不同。以下是常见操作系统的命令:在Linux和macOS系统中,你可以使用以下几种方法来......
  • 调用sdapi/v1/txt2img接口,报错“Couldn‘t load custom C++ ops”
    后端启动stable_diffusion的api接口nohuppythonlaunch.py --use-cpuall--skip-torch-cuda-test   --api--api-log  --listen--server-name192.168.1.204>/home/third_party_app/llm/stable-diffusion-webui/logs/all.log2>&1 &服务接口http://192.168......