Java Web Start无法加载db2jcc.jar

时间:2012-04-04 16:51:04

标签: java db2 jnlp java-web-start securityexception

我已经签署了应用程序所需的每个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。任何人都可以帮我解决这个错误吗?

2 个答案:

答案 0 :(得分:2)

查看处理错误消息的this other SO thread

还有来自security bulletin

的信息
  

混合组件后抛出以下两个SecurityExceptions   之前已被发现,并决定允许他们   共存。例外表明组件名称冲突   在被信任的和。之间检测到(资源名称或类包名称)   不受信任的组件和加载资源或类的请求是   拒绝。

     

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

     

\“”+ packageName +“\”没有   匹配同一包“

中其他类的信任级别

答案 1 :(得分:0)

检查一下http://bugs.sun.com/view_bug.do?bug_id=6967414这可能是导致问题的原因。