Forum Stats

  • 3,760,380 Users
  • 2,251,695 Discussions
  • 7,871,089 Comments

Discussions

java sealing violation with 18.2.0.0

user5066614
user5066614 Member Posts: 2
edited Aug 23, 2018 5:57PM in SQLcl

Hi,

Hi,

I just downloaded 18.2 and am running on Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 under Linux  2.6.32. I get the following error with a simple test.

SQL> select 1 from dual ;

Aug 23, 2018 6:50:43 PM oracle.dbtools.raptor.newscriptrunner.ScriptExecutor run

SEVERE: java.net.URLClassLoader.getAndVerifyPackage(URLClassLoader.java:394)

java.lang.SecurityException: sealing violation: package oracle.jdbc.internal is sealed

        at java.net.URLClassLoader.getAndVerifyPackage(URLClassLoader.java:394)

        at java.net.URLClassLoader.defineClass(URLClassLoader.java:423)

        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:367)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:360)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

        at java.lang.ClassLoader.defineClass1(Native Method)

        at java.lang.ClassLoader.defineClass(ClassLoader.java:760)

        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

        at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)

        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:367)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:360)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

        at oracle.dbtools.raptor.utils.DataTypesUtil.stringValue(DataTypesUtil.java:348)

        at oracle.dbtools.raptor.utils.DataTypesUtil.stringValue(DataTypesUtil.java:202)

        at oracle.dbtools.raptor.utils.DataTypesUtil.stringValue(DataTypesUtil.java:180)

        at oracle.dbtools.raptor.utils.DataTypesUtil.stringValue(DataTypesUtil.java:144)

        at oracle.dbtools.raptor.utils.DataTypesUtil.stringValue(DataTypesUtil.java:139)

        at oracle.dbtools.db.SQLPLUSCmdFormatter.rset2sqlplus(SQLPLUSCmdFormatter.java:1291)

        at oracle.dbtools.db.ResultSetFormatter.rset2sqlplus(ResultSetFormatter.java:309)

        at oracle.dbtools.db.ResultSetFormatter.rset2sqlplus(ResultSetFormatter.java:283)

        at oracle.dbtools.db.ResultSetFormatter.formatResults(ResultSetFormatter.java:144)

        at oracle.dbtools.db.ResultSetFormatter.formatResults(ResultSetFormatter.java:69)

        at oracle.dbtools.raptor.newscriptrunner.SQL.processResultSet(SQL.java:794)

        at oracle.dbtools.raptor.newscriptrunner.SQL.executeQuery(SQL.java:705)

        at oracle.dbtools.raptor.newscriptrunner.SQL.run(SQL.java:82)

        at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.runSQL(ScriptRunner.java:404)

        at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.run(ScriptRunner.java:230)

        at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:341)

        at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:224)

        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.process(SqlCli.java:406)

        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.processLine(SqlCli.java:417)

        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.startSQLPlus(SqlCli.java:1249)

        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:493)

This follows a startup warning:

Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /global/common/genepool_sl72/jgi/oracle_client/11.2.0.3.0/client_1/lib/libocijdbc11.so which might have disabled stack guard. The VM will try to fix the stack guard now.

It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.

But since that library is owned by root, I can't do much about it (also execstack doesn't seem to be installed). Any suggestions?

Answers

  • Glen Conway
    Glen Conway Member Posts: 859 Gold Badge
    edited Aug 23, 2018 5:11PM

    Possible solutions may depend on whether you are using a JDBC thin or thick (oci) connection.  If the ORACLE_HOME environment variable is set, then SQLcl wants to use a thick connection.  Unless the same 'sealing violation' makes them fail, running 'show connection' or 'show jdbc' from SQLcl will show which type of connection is in use (java:oracle:thin or java:oracle:oci8).

    The error complaining about libocijdbc11.so probably indicates use of a thick connection.  So if that is the source of the 'sealing violation' [except I think such a violation means some .class files from a sealed package are getting loaded from two different locations (directories or jar files) rather than the .so or .dll files], then not setting ORACLE_HOME may fix the issue.  But if a thick connection is required, then make sure only a single instance of the jar file containing the package oracle.jdbc.internal is accessible to SQLcl, via the PATH variable, I assume.  Corrections welcome (as I have never seen this issue before!)

  • user5066614
    user5066614 Member Posts: 2
    edited Aug 23, 2018 5:57PM

    Thanks very much for the reply, you're right.  

    I verified that if I unset ORACLE_HOME  then 'show connection' and 'show jdbc' both indicate a thin client and the query works.

    SQL> select 1 from dual ;

             1

    ----------

             1

    SQL> show connection

    CONNECTION: [email protected]:oracle:thin:@farina.jgi-psf.org:1521:xzxxxx

    CONNECTION_IDENTIFIER: farina.jgi-psf.org:1521:xxxxxx

    CONNECTION_DB_VERSION:  Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

    With the Partitioning, OLAP, Data Mining and Real Application Testing options

    NOLOG: false

    PRELIMAUTH: false

    SQL> show jdbc

    -- Database Info --

    Database Product Name: Oracle

    Database Product Version: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

    With the Partitioning, OLAP, Data Mining and Real Application Testing options

    Database Major Version: 11

    Database Minor Version: 2

    -- Driver Info --

    Driver Name: Oracle JDBC driver

    Driver Version: 12.2.0.1.0

    Driver Major Version: 12

    Driver Minor Version: 2

    Driver URL: jdbc:oracle:thin:@farina.jgi-psf.org:1521:xxxxxx

    Driver Location:

    resource: oracle/jdbc/OracleDriver.class

    jar: /global/projectb/scratch/copeland/software/Packages/Util/sqlcl/lib/ojdbc8.jar

    JarSize: 4036257

    JarDate: Thu Feb 08 20:30:44 GMT 2018

    resourceSize: 2604

    resourceDate: Tue Dec 13 08:39:48 GMT 2016