Kylin V10SP1桌面版下GBase 8s java udr异常处理

同样的GBase 8s数据库版本,自定义的java udr在Kylin V10SP1 服务器版(aarch64架构)下创建、运行正常,而在Kylin V10SP1 桌面版(aarch64架构)下时创建正常但运行UDR异常,报错如下:

(38000) - Unknown throwable: (java.lang.NoClassDefFoundError: Could not initialize class sun.security.ec.CurveDB).
Error in line 1
Near character position 62

在jvp.log中显示:

java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at gbasedbt.jvp.dbapplet.impl.SQLJParamImpl.invoke(SQLJParamImpl.java:960)
    at gbasedbt.jvp.dbapplet.impl.PerJavaUDRContext.invokeUDR(PerJavaUDRContext.java:249)
    at gbasedbt.jvp.dbapplet.impl.DBAThreadImpl.runDBApplet(DBAThreadImpl.java:481)
    at gbasedbt.jvp.dbapplet.impl.DBAThreadImpl.runDBWork(DBAThreadImpl.java:378)
    at gbasedbt.jvp.dbapplet.impl.DBAThreadImpl.run(DBAThreadImpl.java:326)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.security.ec.CurveDB
    at sun.security.ec.SunECEntries.putEntries(SunECEntries.java:72)
    at sun.security.ec.SunEC.<init>(SunEC.java:79)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at java.lang.Class.newInstance(Class.java:442)
    at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:221)
    at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:206)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:206)
    at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:187)
    at sun.security.jca.ProviderList.getProvider(ProviderList.java:233)
    at sun.security.jca.ProviderList$ServiceList.tryGet(ProviderList.java:434)
    at sun.security.jca.ProviderList$ServiceList.access$200(ProviderList.java:376)
    at sun.security.jca.ProviderList$ServiceList$1.hasNext(ProviderList.java:486)
    at javax.crypto.SecretKeyFactory.nextSpi(SecretKeyFactory.java:293)
    at javax.crypto.SecretKeyFactory.<init>(SecretKeyFactory.java:121)
    at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:160)
    at JUDREncrypt.encrypt_base64out(JUDREncrypt.java:30)
    ... 9 more
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at gbasedbt.jvp.dbapplet.impl.SQLJParamImpl.invoke(SQLJParamImpl.java:960)
    at gbasedbt.jvp.dbapplet.impl.PerJavaUDRContext.invokeUDR(PerJavaUDRContext.java:249)
    at gbasedbt.jvp.dbapplet.impl.DBAThreadImpl.runDBApplet(DBAThreadImpl.java:481)
    at gbasedbt.jvp.dbapplet.impl.DBAThreadImpl.runDBWork(DBAThreadImpl.java:378)
    at gbasedbt.jvp.dbapplet.impl.DBAThreadImpl.run(DBAThreadImpl.java:326)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.security.ec.CurveDB
    at sun.security.ec.SunECEntries.putEntries(SunECEntries.java:72)
    at sun.security.ec.SunEC.<init>(SunEC.java:79)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at java.lang.Class.newInstance(Class.java:442)
    at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:221)
    at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:206)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:206)
    at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:187)
    at sun.security.jca.ProviderList.getProvider(ProviderList.java:233)
    at sun.security.jca.ProviderList$ServiceList.tryGet(ProviderList.java:434)
    at sun.security.jca.ProviderList$ServiceList.access$200(ProviderList.java:376)
    at sun.security.jca.ProviderList$ServiceList$1.hasNext(ProviderList.java:486)
    at javax.crypto.SecretKeyFactory.nextSpi(SecretKeyFactory.java:293)
    at javax.crypto.SecretKeyFactory.<init>(SecretKeyFactory.java:121)
    at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:160)
    at JUDREncrypt.encrypt_base64out(JUDREncrypt.java:30)
    ... 9 more
   PARAM is not NULL

从错误的描述上来看:java.lang.NoClassDefFoundError: Could not initialize class sun.security.ec.CurveDB,提示为无法初始化sun.security.ec.CurveDB,这个类在两个平台的相同目录中jre/lib/ext/sunec.jar中确认存在。
当前的操作系统信息为:

NAME="Kylin"
VERSION="银河麒麟桌面操作系统V10 (SP1)"
VERSION_US="Kylin Linux Desktop V10 (SP1)"
ID=kylin
ID_LIKE=debian
PRETTY_NAME="Kylin V10 SP1"
VERSION_ID="v10"
HOME_URL="http://www.kylinos.cn/"
SUPPORT_URL="http://www.kylinos.cn/support/technology.html"
BUG_REPORT_URL="http://www.kylinos.cn/"
PRIVACY_POLICY_URL="http://www.kylinos.cn"
VERSION_CODENAME=kylin
UBUNTU_CODENAME=kylin
PROJECT_CODENAME=V10SP1
KYLIN_RELEASE_ID="2303"

出现异常操作系统(桌面版)和正常的操作系统(服务器版)的主要差别是:

  • 服务器版本主要是基于CentOS或者相似发行版。
  • 而桌面版如上面的信息,是基于debian的发行版。

根据以往的经验:由于桌面版的内核要高于服务器版,对程序的要求要新一些,当前GBase 8s自带的jre版本为jre 1.8.0_60,略显偏低,于是更换jre的版本为openjdk 1.8.0_232,重试(需要重启数据库,重新加载jvp),重新创建、运行UDR正常。

注:openjdk_jre_1.8.0_232_aarch64.tar.xz

标签: gbase 8s, udr, GBase, Kylin, jre

添加新评论