“SecurityException: sealing violation” when starting Derby connection

大兔子大兔子 提交于 2019-11-27 15:37:41

问题


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?


回答1:


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




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/6454061/securityexception-sealing-violation-when-starting-derby-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!