“SecurityException:密封违规”启动 Derby 连接时

发布于 2024-11-16 23:21:32 字数 490 浏览 1 评论 0原文

我需要使用“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

风追烟花雨 2024-11-23 23:21:32

您的类路径上可能有两次 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.

亣腦蒛氧 2024-11-23 23:21:32

我面临着同样的问题。我正在使用 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.

秋千易 2024-11-23 23:21:32

我在松鼠中遇到这个问题。我尝试添加新的 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.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文