java.lang.SecurityException: class "org.apache.log4j.Logger"与同一包中其他类的信任级别不匹配 [英] java.lang.SecurityException: class "org.apache.log4j.Logger" does not match trust level of other classes in the same package

查看:105
本文介绍了java.lang.SecurityException: class "org.apache.log4j.Logger"与同一包中其他类的信任级别不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于 Java Web 应用程序,我在使用 JRE 1.6.0_22 时遇到此错误

For an java web application, I got this error when using JRE 1.6.0_22

java.lang.SecurityException: class "org.apache.log4j.Logger" 与同一包中其他类的信任级别不匹配

java.lang.SecurityException: class "org.apache.log4j.Logger" does not match trust level of other classes in the same package

但是,在使用 JRE 1.6.0_13 时它工作正常.

However, it works fine when using JRE 1.6.0_13.

我在谷歌搜索,发现自从 更新 19.

I searched in Google, and find the there is a security enhancement since update 19.

对于这个例外,它说,

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

The following two SecurityExceptions are thrown after mixed components had previously been detected and a decision was made to allow them to coexist. The exceptions indicate that a component name collision (resource name or class package name) was detected between trusted and untrusted components and the request to load the resource or class was denied.

现在的问题是,我如何才能找到发生冲突的类(可能是 org.apache.log4j.Logger?)以及它们在哪些包中?

Now the problem is, how could i find which classes (maybe org.apache.log4j.Logger?) have the collision and which packages they are in?

我发现 Oracle 论坛中有类似的问题

I find there is a similar question in Oracle forums

推荐答案

有趣的链接.我还没有遇到这个问题 - 但可能是你在 Web 应用程序中 的某个地方的 JavaEE 容器类路径中有带有org.apache ..."的 jar.

Interesting link. I didn't have the problem yet - but may it be that you have the jar with "org.apache..." in the JavaEE container classpath somewhere and in the web application.

查找并测试将其从网络应用程序中删除

Look for that and to test remove it from the web app

这篇关于java.lang.SecurityException: class "org.apache.log4j.Logger"与同一包中其他类的信任级别不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆