“SecurityException:密封违规”启动 Derby 连接时
我需要使用“org.apache.derby.drda.NetworkServerControl”类从我的 java 应用程序启动 derby 服务器。
当我尝试启动服务器时,它抛出异常。
代码:
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
有人能告诉我这个错误的原因吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的类路径上可能有两次 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.
我面临着同样的问题。我正在使用 One Jar 打包我的应用程序。 One Jar 有它自己的类加载器,这可能会导致问题。如果您使用的是 One Jar,请尝试在不使用 One Jar 的情况下打包您的应用程序并进行验证。
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.
我在松鼠中遇到这个问题。我尝试添加新的 Derby 嵌入式驱动程序,但出现错误。
然后我关闭了Squirrel,从“c:\Program Files\squirrel-sql-3.5.0\lib\”中删除了derby**.jar,启动Squirrel并成功添加了新驱动程序。
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.