Pummy
Pummy

Reputation: 73

"SecurityException: sealing violation" when starting Derby connection

I need do start the derby server from my java application using "org.apache.derby.drda.NetworkServerControl" class.
When I try to start the server it throws an exception.

Code:

NetworkServerControl server = null; 
server=new NetworkServerControl(InetAddress.getLocalHost(),1527,"user","123")
server.start(new PrintWriter(System.out));

Error:

Caused by: java.lang.SecurityException: sealing violation: package org.apache.derby.impl.store.raw.xact is sealed

Can anybody tell me the reason for this error?

Upvotes: 5

Views: 10454

Answers (3)

Kyrylo Semenko
Kyrylo Semenko

Reputation: 956

I has this problem in Squirrel. I tried to add a new Derby embedded driver and I had the error.

Then I closed Squirrel, removed derby**.jar from "c:\Program Files\squirrel-sql-3.5.0\lib\", started Squirrel and added the new driver successfully.

enter image description here

Upvotes: 0

Chitrang
Chitrang

Reputation: 11

I was facing same problem. I was packaging my application using One Jar. One Jar has it's own class loader which could cause the issue. If you are using One Jar, Try packaging your app without One Jar and verify.

Upvotes: 1

Robert Balent
Robert Balent

Reputation: 1462

You have probably Derby classes twice on your classpath. Look for Derby classes in some another jar archive and use them only once.

Upvotes: 18

Related Questions