1

我已经签署了应用程序所需的每个 jar,但是在尝试启动时,它会产生以下异常:

java.lang.SecurityException: class "com.ibm.db2.jcc.DB2Driver" does not match trust level of other classes in the same package
at com.sun.deploy.security.CPCallbackHandler$ChildElement.checkResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.ibm.nzna.shared.db.DatabaseSystem.<init>(DatabaseSystem.java:193)
at com.ibm.nzna.projects.qit.Qit.run(Qit.java:556)
at com.ibm.nzna.projects.qit.Qit.<init>(Qit.java:185)
at com.ibm.nzna.projects.qit.Qit.main(Qit.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

我也签了db2jcc.jar。有人可以帮我解决这个错误吗?

4

2 回答 2

2

查看处理错误消息的其他 SO 线程。

还有来自安全公告的信息,

在先前检测到混合组件并决定允许它们共存之后,将引发以下两个 SecurityExceptions。异常表明在受信任和不受信任的组件之间检测到组件名称冲突(资源名称或类包名称),并且加载资源或类的请求被拒绝。

“资源\””+名称+“\”与其他同名资源的信任级别不匹配“”类

\"" + packageName + "\" 与同一包中其他类的信任级别不匹配"

于 2012-04-04T18:06:32.727 回答
0

看看这个http://bugs.sun.com/view_bug.do?bug_id=6967414这可能是你的问题的原因。

于 2012-04-11T07:53:45.550 回答