Informix

 View Only
  • 1.  UUID initialization failure IDS 14.10.FC8

    Posted Fri February 17, 2023 11:38 AM

    I am trying to use the UUID function according to the documentation, but I end up with an error :

    CREATE FUNCTION UUID() RETURNING CHAR(36) EXTERNAL NAME 'com.informix.judrs.IfxStrings.getUUID()' language java;
    GRANT EXECUTE ON UUID TO PUBLIC;

    CREATE TABLE test(a char(36), b int);
    INSERT INTO test VALUES(UUID(), 5);

    SQL Error (-937): Unknown throwable: (java.lang.NoClassDefFoundError: java.util.UUID$Holder (initialization failure)).

    Any idea how to solve this?



    ------------------------------
    Vladimir Tomanicek
    ------------------------------


  • 2.  RE: UUID initialization failure IDS 14.10.FC8

    Posted Fri February 17, 2023 12:52 PM

    So what's your server's online.log showing?

    Mine, upon first call to this function:

    18:48:59  Booting Language <java> from module <$INFORMIXDIR/extend/krakatoa/lmjava.so>
    18:48:59  Loading Module <$INFORMIXDIR/extend/krakatoa/lmjava.so>
    18:48:59  The C Language Module </opt/informix/IBM/14.10.FC9W1/extend/krakatoa/lmjava.so> loaded
    18:48:59  Loading Module <com.informix.judrs.IfxStrings>
    18:48:59  INFO (autoregvp 6) (Execution of [ autoregvp ] dymamically creating VPCLASS jvp)
    18:49:00  Dynamically added 1 jvp VP
    18:49:00  Got the mutex
    18:49:00  LD_LIBRARY_PATH=/opt/informix/IBM/14.10.FC9W1/extend/krakatoa/jre/bin/j9vm
    18:49:00  VM args[0]= -Xss512k
    18:49:00  VM args[1]= -Djava.security.policy=/opt/informix/IBM/14.10.FC9W1/tmp/JVM_security
    18:49:00  VM args[2]= -Xms16m
    18:49:00  VM args[3]= -Xmx16m
    18:49:00  VM args[4]= exit
    18:49:00  VM args[5]= abort
    18:49:00  VM args[6]= -Djava.class.path=/opt/informix/IBM/14.10.FC9W1/extend/krakatoa/krakatoa.jar:/opt/informix/IBM/14.10.FC9W1/extend/krakatoa/jdbc.jar:/opt/informix/IBM/14.10.FC9W1/extend/krakatoa
    18:49:01  Successfully created Java VM.



    ------------------------------
    Andreas Legner
    ------------------------------



  • 3.  RE: UUID initialization failure IDS 14.10.FC8

    Posted Mon February 20, 2023 10:50 AM

    Hi Andreas,
    thanks for response.

    From online.log :
    16:18:30  Booting Language <java> from module <$INFORMIXDIR/extend/krakatoa/lmjava.so>
    16:18:30  Loading Module <$INFORMIXDIR/extend/krakatoa/lmjava.so>
    16:18:30  The C Language Module </usr/informix/ids14/extend/krakatoa/lmjava.so> loaded
    16:18:30  Loading Module <com.informix.judrs.IfxStrings>
    16:18:30  Got the mutex
    16:18:30  LIBPATH=/usr/informix/ids14/extend/krakatoa/jre/bin/classic:/usr/informix/ids14/extend/krakatoa/jre/bin:/usr/informix/ids14/extend/krakatoa/jre/lib/ppc64
    16:18:30  VM args[0]= -Xss512k
    16:18:30  VM args[1]= -Djava.security.policy=/usr/informix/ids14/tmp/JVM_security
    16:18:30  VM args[2]= -Xms16m
    16:18:30  VM args[3]= -Xmx16m
    16:18:30  VM args[4]= exit
    16:18:30  VM args[5]= abort
    16:18:30  VM args[6]= -Djava.class.path=/usr/informix/ids14/extend/krakatoa/krakatoa.jar:/usr/informix/ids14/extend/krakatoa
    16:18:30  Successfully created Java VM.

    From onconfig :
    VPCLASS       jvp,num=1
    JVPPROPFILE   $INFORMIXDIR/extend/krakatoa/.jvpprops
    JVPCLASSPATH  $INFORMIXDIR/extend/krakatoa/krakatoa.jar
    JVPJAVAHOME   $INFORMIXDIR/extend/krakatoa/jre
    JVPHOME       $INFORMIXDIR/extend/krakatoa

    From jvp.log :
    16:18:31.153 [main] INFO  i.j.dbapplet.impl.UDRDBAContextImpl - Initializing J/Foundation
    16:18:31.161 [main] INFO  i.j.dbapplet.impl.UDRDBAContextImpl - Loading native library: /usr/informix/ids14/extend/krakatoa/libjvp.so
    16:18:31.164 [main] WARN  jvp - TraceableImpl: trace settings property is null
    16:18:31.171 [jvp-worker-1] INFO  i.jvp.dbapplet.impl.DBAThreadImpl - Thread Thread[jvp-worker-1,9,main],state = IN-POOL T#1 IN POOL WAITS FOR WORK
    16:18:31.171 [jvp-worker-2] INFO  i.jvp.dbapplet.impl.DBAThreadImpl - Thread Thread[jvp-worker-2,9,main],state = IN-POOL T#2 IN POOL WAITS FOR WORK
    16:18:31.172 [main] INFO  i.j.d.impl.DBAThreadPoolPatrol - DBAThreadPool Patrol started
    16:18:31.172 [main] INFO  i.j.dbapplet.impl.UDRDBAContextImpl - DBAThread Pool is enabled with size = 2 with patrol interval = 5
    16:18:31.178 [main] INFO  i.j.d.impl.SAPIRequestFreeList - SAPIRequestFreeList: Instantiating SAPI request pool
    16:18:31.178 [main] INFO  i.j.d.impl.SAPIRequestFreeList - SAPIRequestFreeList: Instantiating SAPI request pool [COMPLETE]
    16:18:31.196 [main] INFO  system.out - Informix JDBC Driver Version 4.50.JC3
    16:18:31.198 [MT Alarm Thread] ERROR system.err - Alarm Time set to 3
    16:18:31.201 [main] INFO  i.j.dbapplet.impl.UDRDBAContextImpl - Acquiring a jvp-worker thread: open context for com.informix.judrs.IfxStrings of thread group java.lang.ThreadGroup[name=DBAPPLET,maxpri=10]
    16:18:31.202 [main] INFO  i.jvp.dbapplet.impl.DBAThreadImpl - Thread Thread[jvp-worker-1,9,main],state = IN-POOL T#1 IN POOL GETS WORK
    16:18:31.202 [jvp-worker-1] INFO  i.jvp.dbapplet.impl.DBAThreadImpl - start runDBWork
    16:18:31.206 [jvp-worker-1] INFO  i.j.dbapplet.impl.PerJavaUDRContext - Initialising JAVA UDR Context
    16:18:31.603 [jvp-worker-1] ERROR i.jvp.dbapplet.impl.SQLJParamImpl - Unknown exception occurred.
    java.lang.reflect.InvocationTargetException: null
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
            at java.lang.reflect.Method.invoke(Method.java:508)
            at informix.jvp.dbapplet.impl.SQLJParamImpl.invoke(SQLJParamImpl.java:720)
            at informix.jvp.dbapplet.impl.PerJavaUDRContext.invokeUDR(PerJavaUDRContext.java:191)
            at informix.jvp.dbapplet.impl.DBAThreadImpl.runDBApplet(DBAThreadImpl.java:411)
            at informix.jvp.dbapplet.impl.DBAThreadImpl.runDBWork(DBAThreadImpl.java:328)
            at informix.jvp.dbapplet.impl.DBAThreadImpl.run(DBAThreadImpl.java:295)
    Caused by: java.lang.ExceptionInInitializerError: null
            at java.lang.J9VMInternals.ensureError(J9VMInternals.java:145)
            at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:134)
            at java.util.UUID.randomUUID(UUID.java:153)
            at com.informix.judrs.IfxStrings.getUUID(IfxStrings.java:62)
            ... 9 common frames omitted
    Caused by: java.security.ProviderException: Failed to initialize IBMJCEPlus provider
            at com.ibm.crypto.plus.provider.IBMJCEPlus.a(IBMJCEPlus.java:185)
            at com.ibm.crypto.plus.provider.IBMJCEPlus.e(IBMJCEPlus.java:139)
            at com.ibm.crypto.plus.provider.IBMJCEPlus.a(IBMJCEPlus.java:162)
            at com.ibm.crypto.plus.provider.h.run(h.java:1)
            at java.security.AccessController.doPrivileged(AccessController.java:682)
            at com.ibm.crypto.plus.provider.IBMJCEPlus.<init>(IBMJCEPlus.java:260)
            at java.lang.J9VMInternals.newInstanceImpl(Native Method)
            at java.lang.Class.newInstance(Class.java:2062)
            at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:233)
            at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:218)
            at java.security.AccessController.doPrivileged(AccessController.java:682)
            at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:218)
            at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:199)
            at sun.security.jca.ProviderList.getProvider(ProviderList.java:245)
            at sun.security.jca.ProviderList$3.get(ProviderList.java:160)
            at sun.security.jca.ProviderList$3.get(ProviderList.java:155)
            at java.util.AbstractList$Itr.next(AbstractList.java:369)
            at java.security.SecureRandom.getPrngAlgorithm(SecureRandom.java:567)
            at java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:205)
            at java.security.SecureRandom.<init>(SecureRandom.java:173)
            at java.util.UUID$Holder.<clinit>(UUID.java:107)
            ... 11 common frames omitted
    Caused by: java.security.ProviderException: jgskit (Not a directory)
            at com.ibm.crypto.plus.provider.IBMJCEPlus.e(IBMJCEPlus.java:114)
            ... 30 common frames omitted
    16:18:31.605 [jvp-worker-1] ERROR i.jvp.dbapplet.impl.SQLJParamImpl - UDR Invoation exception
    java.lang.reflect.InvocationTargetException: null
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
            at java.lang.reflect.Method.invoke(Method.java:508)
            at informix.jvp.dbapplet.impl.SQLJParamImpl.invoke(SQLJParamImpl.java:720)
            at informix.jvp.dbapplet.impl.PerJavaUDRContext.invokeUDR(PerJavaUDRContext.java:191)
            at informix.jvp.dbapplet.impl.DBAThreadImpl.runDBApplet(DBAThreadImpl.java:411)
            at informix.jvp.dbapplet.impl.DBAThreadImpl.runDBWork(DBAThreadImpl.java:328)
            at informix.jvp.dbapplet.impl.DBAThreadImpl.run(DBAThreadImpl.java:295)
    Caused by: java.lang.ExceptionInInitializerError: null
            at java.lang.J9VMInternals.ensureError(J9VMInternals.java:145)
            at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:134)
            at java.util.UUID.randomUUID(UUID.java:153)
            at com.informix.judrs.IfxStrings.getUUID(IfxStrings.java:62)
            ... 9 common frames omitted
    Caused by: java.security.ProviderException: Failed to initialize IBMJCEPlus provider
            at com.ibm.crypto.plus.provider.IBMJCEPlus.a(IBMJCEPlus.java:185)
            at com.ibm.crypto.plus.provider.IBMJCEPlus.e(IBMJCEPlus.java:139)
            at com.ibm.crypto.plus.provider.IBMJCEPlus.a(IBMJCEPlus.java:162)
            at com.ibm.crypto.plus.provider.h.run(h.java:1)
            at java.security.AccessController.doPrivileged(AccessController.java:682)
            at com.ibm.crypto.plus.provider.IBMJCEPlus.<init>(IBMJCEPlus.java:260)
            at java.lang.J9VMInternals.newInstanceImpl(Native Method)
            at java.lang.Class.newInstance(Class.java:2062)
            at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:233)
            at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:218)
            at java.security.AccessController.doPrivileged(AccessController.java:682)
            at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:218)
            at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:199)
            at sun.security.jca.ProviderList.getProvider(ProviderList.java:245)
            at sun.security.jca.ProviderList$3.get(ProviderList.java:160)
            at sun.security.jca.ProviderList$3.get(ProviderList.java:155)
            at java.util.AbstractList$Itr.next(AbstractList.java:369)
            at java.security.SecureRandom.getPrngAlgorithm(SecureRandom.java:567)
            at java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:205)
            at java.security.SecureRandom.<init>(SecureRandom.java:173)
            at java.util.UUID$Holder.<clinit>(UUID.java:107)
            ... 11 common frames omitted
    Caused by: java.security.ProviderException: jgskit (Not a directory)
            at com.ibm.crypto.plus.provider.IBMJCEPlus.e(IBMJCEPlus.java:114)
            ... 30 common frames omitted
    16:18:31.607 [jvp-worker-1] ERROR i.jvp.dbapplet.impl.DBAThreadImpl - Unknown Exception thrown during UDR execution
    java.lang.ExceptionInInitializerError: null
            at java.lang.J9VMInternals.ensureError(J9VMInternals.java:145)
            at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:134)
            at java.util.UUID.randomUUID(UUID.java:153)
            at com.informix.judrs.IfxStrings.getUUID(IfxStrings.java:62)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
            at java.lang.reflect.Method.invoke(Method.java:508)
            at informix.jvp.dbapplet.impl.SQLJParamImpl.invoke(SQLJParamImpl.java:720)
            at informix.jvp.dbapplet.impl.PerJavaUDRContext.invokeUDR(PerJavaUDRContext.java:191)
            at informix.jvp.dbapplet.impl.DBAThreadImpl.runDBApplet(DBAThreadImpl.java:411)
            at informix.jvp.dbapplet.impl.DBAThreadImpl.runDBWork(DBAThreadImpl.java:328)
            at informix.jvp.dbapplet.impl.DBAThreadImpl.run(DBAThreadImpl.java:295)
    Caused by: java.security.ProviderException: Failed to initialize IBMJCEPlus provider
            at com.ibm.crypto.plus.provider.IBMJCEPlus.a(IBMJCEPlus.java:185)
            at com.ibm.crypto.plus.provider.IBMJCEPlus.e(IBMJCEPlus.java:139)
            at com.ibm.crypto.plus.provider.IBMJCEPlus.a(IBMJCEPlus.java:162)
            at com.ibm.crypto.plus.provider.h.run(h.java:1)
            at java.security.AccessController.doPrivileged(AccessController.java:682)
            at com.ibm.crypto.plus.provider.IBMJCEPlus.<init>(IBMJCEPlus.java:260)
            at java.lang.J9VMInternals.newInstanceImpl(Native Method)
            at java.lang.Class.newInstance(Class.java:2062)
            at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:233)
            at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:218)
            at java.security.AccessController.doPrivileged(AccessController.java:682)
            at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:218)
            at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:199)
            at sun.security.jca.ProviderList.getProvider(ProviderList.java:245)
            at sun.security.jca.ProviderList$3.get(ProviderList.java:160)
            at sun.security.jca.ProviderList$3.get(ProviderList.java:155)
            at java.util.AbstractList$Itr.next(AbstractList.java:369)
            at java.security.SecureRandom.getPrngAlgorithm(SecureRandom.java:567)
            at java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:205)
            at java.security.SecureRandom.<init>(SecureRandom.java:173)
            at java.util.UUID$Holder.<clinit>(UUID.java:107)
            ... 11 common frames omitted
    Caused by: java.security.ProviderException: jgskit (Not a directory)
            at com.ibm.crypto.plus.provider.IBMJCEPlus.e(IBMJCEPlus.java:114)
            ... 30 common frames omitted
    16:18:31.643 [jvp-worker-1] INFO  i.jvp.dbapplet.impl.DBAMonitorImpl - notify JAVA UDR error



    ------------------------------
    Vladimir Tomanicek
    ------------------------------



  • 4.  RE: UUID initialization failure IDS 14.10.FC8

    Posted Fri February 17, 2023 01:08 PM

    Created UUIDGenerator.java:
    import java.util.UUID;

    public class UUIDGenerator {
        public static String generateUUID() {
            UUID uuid = UUID.randomUUID();
            return uuid.toString();
        }
    }

    Compile it:
    javac -source 1.8 -target 1.8 UUIDGenerator.java

    Create jar file:
    jar cf UUIDGenerator.jar UUIDGenerator.class

    SQL file:
    -- install
    execute procedure sqlj.install_jar ("file://home/informix/profiles/uuid/UUIDGenerator.jar" , "UUIDGenerator_jar");

    -- register function
    create function generate_uuid() returning  CHAR(36) external name "UUIDGenerator_jar:UUIDGenerator.generateUUID" language JAVA;

    -- use it
    SELECT generate_uuid() FROM sysmaster:sysdual;
    (expression)  7bdcfcfb-1a9f-4e13-98db-49d2c5932143

    HTH Hrvoje



    ------------------------------
    Hrvoje Zokovic
    ------------------------------



  • 5.  RE: UUID initialization failure IDS 14.10.FC8

    Posted Mon February 20, 2023 11:12 AM

    Hi Hrvoje,
    I'm trying to use the built-in UUID function according to Informix Server 14.10 documentation :
    https://www.ibm.com/docs/en/informix-servers/14.10?topic=SSGU8G_14.1.0/com.ibm.sqls.doc/ids_sqs_extend_chr_utility_uuid.html

    I suppose your recommendation is to create a custom external java UUID function.



    ------------------------------
    Vladimir Tomanicek
    ------------------------------



  • 6.  RE: UUID initialization failure IDS 14.10.FC8

    Posted Tue February 21, 2023 12:19 PM

    hi,

    Hrvoje's solution should not work in your case as it uses the exact same API calls as our built-in Java UDR.  The problem from the stack looks like an error in IBM's JRE itself which is bad news. Not sure if the machine is in production, but if there is downtime on the instance or it's a test instance you can see about upgrading/changing the JRE being used to see if it solves the problem?



    ------------------------------
    Brian Hughes
    ------------------------------



  • 7.  RE: UUID initialization failure IDS 14.10.FC8

    Posted Tue April 18, 2023 10:34 AM

    The Java problem was in the file :
    $INFORMIXDIR/jvm/jre/lib/security/java.security

    in the section :
    # List of providers and their preference orders :
    security.provider.1=com.ibm.jsse2.IBMJSSEProvider2
    security.provider.2=com.ibm.crypto.plus.provider.IBMJCEPlus
    security.provider.3=com.ibm.crypto.provider.IBMJCE
    security.provider.4=com.ibm.security.jgss.IBMJGSSProvider
    security.provider.5=com.ibm.security.cert.IBMCertPath
    security.provider.6=com.ibm.security.sasl.IBMSASL
    security.provider.7=com.ibm.xml.crypto.IBMXMLCryptoProvider
    security.provider.8=com.ibm.xml.enc.IBMXMLEncProvider
    security.provider.9=com.ibm.security.jgss.mech.spnego.IBMSPNEGO
    security.provider.10=sun.security.provider.Sun

    It was necessary to remove the entry :
    security.provider.2=com.ibm.crypto.plus.provider.IBMJCEPlus
    and update the order.
    (maybe it would be enough to switch the order of the IBMJCE/ IBMJCEPlus entries)

    Then restart the server or all jvp.



    ------------------------------
    Vladimir Tomanicek
    ------------------------------



  • 8.  RE: UUID initialization failure IDS 14.10.FC8

    Posted Tue April 18, 2023 09:16 PM

    Not all security based systems are java scrum on sysrad.

    http://cryphosnegative.blogspot.com/



    ------------------------------
    KIN BUENO
    ------------------------------