sealing violation: package oracle.net.ns is sealed
Asked Answered
S

2

10

I am trying to connect to an Oracle 11g XE databse using Oracle SQL Developer. However, I am getting the following exception:

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

I have searched for an answer on the web, but have not found a solution.

What is causing this and how can I fix it?

Skutchan answered 5/4, 2017 at 12:52 Comment(2)
can you show your code?Clock
review this: #4922869Banana
J
12

From this documentation at Oracle : Known Issues and Limitations :

java.lang.SecurityException: Sealing violation exception (ID 6554602)

Description

Starting with JDBC 10.2 drivers, having more than one JDBC jar file in the CLASSPATH may result in a java.lang.SecurityException: Sealing violation exception.

Solution (Suggested by Oracle) Make sure that the CLASSPATH includes only one JDBC driver JAR file.

And this forum : SecurityException: sealing violation from Class.forName

A sealing violation means that some classes from a sealed package were loaded from two different locations (directories or jar files).

A sealed package is one that essentially says "I know that all classes in this package come from a single jar file. For security reason no other location may provide classes that are in this package".

Chances are you have two Oracle JDBC driver jars in your classpath.

So make sure that you don't have multiple Oracle JDBC driver jar libraries in your classpath.

Jeffry answered 5/4, 2017 at 13:3 Comment(2)
C:\Users\aVinci>ECHO %CLASSPATH% C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_111\lib;C:\Program Files\Java\jre1.8.0_111\lib;C:\Users\aVinci\AppData\Local\Android\Sdk\platform-tools;C:\Users\aVinci\AppData\Local\Android\Sdk\tools;.Skutchan
@VinciADePaul : check the jars contained in those different locations.Jeffry
E
2

It happens when you have more than one JDBC jar file in the CLASSPATH.

Eliath answered 5/4, 2017 at 13:5 Comment(2)
@berger THIS is my classpath, and there is no jar file: C:\Users\aVinci>ECHO %CLASSPATH% C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_111\lib;C:\Program Files\Java\jre1.8.0_111\lib;C:\Users\aVinci\AppData\Local\Android\Sdk\platform-tools;C:\Users\aVinci\AppData\Local\Android\Sdk\tools;.Skutchan
Make you sure Oracle SQL Developer classpath is not defined as -cp option on the command line that runs it. Furthermore, directories listed in the the CLASSPATH environment variable could contain jdbc driver.Eliath

© 2022 - 2024 — McMap. All rights reserved.