相关疑难解决方法(0)

AccessController.doPrivileged

我想弄清楚一些遗留代码在做什么.这条线到底在做什么,为什么我会这样需要呢?

String lineSeparator = (String) java.security.AccessController.doPrivileged(
       new sun.security.action.GetPropertyAction("line.separator")); 
Run Code Online (Sandbox Code Playgroud)

我在Weblogic 8上运行的web/ejb应用程序的logger实现中找到了它.据我所知,没有启用特殊的安全策略.(我不喜欢从sun.*包中导入,所以我想摆脱这条线;-)

java security api java-ee

20
推荐指数
1
解决办法
2万
查看次数

为什么我的applet得到java.security.AccessControlException:访问被拒绝(java.net.SocketPermission ...),我该如何避免它?

我们对我的客户端在Safari中遇到Java安全性异常的原因一无所知.有人可以帮忙吗?

在Windows上的Safari中可靠地发生异常.这涉及Java applet.Windows Vista上的Firefox和IE8也会出现异常.

以下是重现的步骤:

  1. 在Windows上打开Safari

  2. 点击此处:http://www.cengraving.com/s/item?icmId = CH003

  3. 点击"自定义"(在屏幕底部)

  4. 加载"Instant Proof"页面后,单击"添加到购物车".

完整堆栈跟踪:

java.security.AccessControlException: access denied (java.net.SocketPermission www.cengraving.com resolve)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkConnect(Unknown Source)
    at sun.plugin.security.ActivatorSecurityManager.checkConnect(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getAllByName(Unknown Source)
    at java.net.InetAddress.getAllByName(Unknown Source)
    at java.net.InetAddress.getByName(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
    at com.designapplet.a.f.a(Unknown Source)
    at com.designapplet.ui.c.a(Unknown Source)
    at com.designapplet.ui.c.for(Unknown Source)
    at com.designapplet.ui.DesignApplet.buy(Unknown Source)
    at …
Run Code Online (Sandbox Code Playgroud)

java safari applet exception

17
推荐指数
3
解决办法
7万
查看次数

标签 统计

java ×2

api ×1

applet ×1

exception ×1

java-ee ×1

safari ×1

security ×1