Welcome Guest! Log in

SQLException " Unsupported major.minor version 52.0" when connecting to a JDBC database

    SYMPTOM

    When connecting to a JDBC database, an error message similar to the following ones is displayed.

    Example 1:

    java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 52.0
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
     at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
     at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Class.java:188)

     

    Example 2:

    Caused by: java.lang.UnsupportedClassVersionError: com/mysql/cj/jdbc/Driver : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1415)

    Solution

    Check if your Java version and JDBC driver version are compatible by using the database documentation.

    For example:
    Postgresql: https://jdbc.postgresql.org/download.html
    MySQL: https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-versions.html

    SSH Action does not load environment variables

      Symptom

      When executing a SSH command with the "Execute SSH" Action, some environment variables are not loaded / initialized.

      It seems that the SSH session does not load the Linux user's environment or profile.

      Solution

      The Execute SSH action opens a non-interactive shell session on the remote server. With this kind of session, the shell does not load the user's environement and profile scripts (see documentation for bash for example), this is why some environment variables are not available.

      Simple test to confirm this case: compare the result of the "set" command in your prefered Terminal application and in the output of Stambia's Execute SSH.

      A simple way to load environment variables is to source a config file at the beginning of your Execute SSH action Code:

      source /home/user/some_config.sh
      echo "$myvar is set"
      start_something.sh -o "${~/param}$"

       

      Error "Failed to parse with generic parser" when executing a mapping

        Symptom

        When executing a mapping (or a process containing a mapping), the following error occurs on a SQL Operation action: "Failed to parse with generic parser".

        Solution

        • If one of the column names starts with a number then enclose this column name with delimiters in the mapping expression, such as this Sql Server example (adapt it to your database):

        517 mapping

        • If no column starts with a number then contact support

        Error when working with File: FileDriverStatement::executeQuery, error opening the file

          Symptom

          When working with a File metadata (executing a read or write mapping, replicate File to rdbms...) the following error occurs :

          Error: FileDriverStatement::executeQuery, error opening the file \\servername\d$\Data\IN\CUSTOMER-20180808-134523.txt

          The file is located on a shared drive.

          Solution

          This is generally due to permission issues.

          • Verify that the user which runs the Runtime has permission on the shared drive
          • Alternatively, share the folder instead of the drive : \\servername\IN\...

           

          Error "Class not found" or "Method not found" when executing a mapping or a process

            Symptom

            During an execution of a process or a mapping on a runtime that contains additional plugins (like for example AWS, ElasticSearch) you receive an error saying « Class was not found » or « Method was not found ».

            For example:

            com.indy.engine.common.exceptions.EngineExceptionI: A class was not found in the engine, contact your supplier
            at com.indy.engine.action.common.ActionCodeTypeI.executeCode(SourceFile:1724)
            at com.indy.engine.action.common.ActionCodeTypeI.run(SourceFile:1852)
            at java.lang.Thread.run(Thread.java:745)
            Caused by: java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger
            at javax.mail.Session.initLogger(Session.java:227)
            at javax.mail.Session.<init>(Session.java:212)
            at javax.mail.Session.getInstance(Session.java:248)
            at com.indy.engine.actionCodes.SendMailActionCodeI.executeSimpleCode(SourceFile:326)
            at com.indy.engine.action.common.ActionCodeTypeI.executeCode(SourceFile:1693)

            Solution

            This usually means that there are two conflicting java libraries in your runtime installation and Stambia is using the incorrect one. Some plugins come with a set of java libraries that may cause conflicts with the ones already existing in Stambia installation.

            In the example above the error was caused by Amazon AWS SDK which contains file javax.mail-api-1.4.6.jar in amazon/third-party/lib. This file caused a conflict which resulted with the error when executing Send Mail action.

            To resolve the conflict you will need to remove the library added with the plugin.

             

            Knowledge Base

            Suggest a new Article!