“SecurityException:密封违规"启动 Derby 连接时
我需要使用org.apache.derby.drda.NetworkServerControl
"类从我的 java 应用程序启动 derby 服务器.
当我尝试启动服务器时,它会引发异常.
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.
代码:
NetworkServerControl server = null;
server=new NetworkServerControl(InetAddress.getLocalHost(),1527,"user","123")
server.start(new PrintWriter(System.out));
错误:
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?
推荐答案
你的类路径中可能有两次 Derby 类.在另一个 jar 档案中查找 Derby 类,并且只使用它们一次.
You have probably Derby classes twice on your classpath. Look for Derby classes in some another jar archive and use them only once.
相关文章