标签: securityexception

从Silverlight调用WCF服务

我从silverlight调用本地托管的wcf服务,我在下面得到了例外.

Iv创建了一个clientaccesspolicy.xml,它位于我的主机路由中.

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>
Run Code Online (Sandbox Code Playgroud)

尝试向URI" http:// localhost:8005/Service1.svc " 发出请求时发生错误.这可能是由于跨域配置错误.有关更多详细信息,请参阅内部异常.--->

{System.Security.SecurityException ---> System.Security.SecurityException:安全错误.在MS.Internal.InternalWebRequest.Send()在System.Net.BrowserHttpWebRequest.BeginGetResponseImplementation()在System.Net.BrowserHttpWebRequest.InternalBeginGetResponse(AsyncCallback的回调,对象状态)在System.Net.AsyncHelper.<> c__DisplayClass4.b__3(对象sendState )---内部异常堆栈跟踪的末尾在System.Net.AsyncHelper.BeginOnUI(beginMethod beginMethod,AsyncCallback的回调,对象状态)在System.Net.BrowserHttpWebRequest.BeginGetResponse(AsyncCallback的回调,对象状态)在System.ServiceModel .Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteSend(IAsyncResult的结果)在System.ServiceModel.Channels.HttpChannelFactory.

关于如何进步的任何想法?

silverlight wcf securityexception

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

PDF发送意图上的Android SecurityException

ACTION_SEND具有数据类型的意图期间,我收到以下异常application/pdf:

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.SEND typ=application/pdf flg=0x3080000 cmp=com.adobe.reader/.ARSendForSignature (has extras) }
Run Code Online (Sandbox Code Playgroud)

这将打开一个对话框,选择接收PDF的所需应用程序.我相信SecurityException当用户从列表中选择Adobe Reader时,它会被抛出,尽管它似乎特意打开了该ARSendForSignature活动.

有任何想法吗?

android securityexception permission-denied android-intent

4
推荐指数
1
解决办法
1257
查看次数

applet死了吗?

很久以前我做了一个小程序,当我几天前在网站上尝试打开它时,它说有一个安全问题,它无法打开它.

我用Google搜索,看到我需要注册它.

我试着注册但没有任何帮助.

你能解释一下可以解决这个问题吗?

当我从eclipse运行它时,applet很好并且正常工作.

java security applet securityexception

4
推荐指数
1
解决办法
691
查看次数

如何检查用户是否从游戏服务默认视图中退出?

我在游戏中整合了谷歌游戏服务,包括排行榜和成就.如果用户打开排行榜或成就活动,他可以从右上角的设置中退出.

如何检查用户是否确实已登录?getGamesClient.isConnected()仍然是,但用户从谷歌视图退出.

如果我点击退出按钮(仍然存在,因为gamesClient仍然连接)我得到一个SecurityException:

08-16 11:01:21.262 14288-14288 /?E/AndroidRuntime:FATAL EXCEPTION:位于com.google.android的android.os.Parcel.readException(Parcel.java:1379)的android.os.Parcel.readException(Parcel.java:1425)中的主要java.lang.SecurityException.来自com.google.android.gms.games.GamesClient.signOut(未知来源)的com.google.android.gms.internal.bj.signOut(未知来源)的gms.internal.bm $ a $ aa(未知来源)

目前,我正在检查ActivityForResult响应代码并断开GamesClient,如果它处于不一致状态,但我不喜欢这种方法.

android securityexception google-plus google-play-games

3
推荐指数
1
解决办法
3908
查看次数

为什么你不能在java.lang中创建类?

假设我LangTest.java以下列方式创建一个类:

package java.lang;

public class LangTest 
{
    public static void show()
    {
        System.out.println("In langTest.show()");
    }
}
Run Code Online (Sandbox Code Playgroud)

在另一个类中,我甚至将该方法称为:

LangTest.show();
Run Code Online (Sandbox Code Playgroud)

他们都没有给出任何编译问题,但在运行时它会抛出异常. -

Exception in thread "main" java.lang.SecurityException: Prohibited package name: java.lang
    at java.lang.ClassLoader.preDefineClass(ClassLoader.java:479)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:614)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at com.javatpoint.Test.main(Test.java:28)
Run Code Online (Sandbox Code Playgroud)

只要您创建以" java." 开头的包名称,就会发生这种情况.

我的问题是为什么我们不允许在java.lang或类似的东西中创建一个类?而且,为什么在这种情况下没有给出编译错误?

java securityexception compilation

3
推荐指数
1
解决办法
762
查看次数

在 Android 6 上出现“无权写入 APN 设置”错误

我的应用程序在 Android 5.0 及更低版本上运行良好,但是当我尝试在 Android 6.0 或更高版本的设备上运行它时,出现以下错误:

Writing exception to parcel
                                                 java.lang.SecurityException: No permission to write APN settings
                                                     at com.android.providers.telephony.TelephonyProvider.checkPermission(TelephonyProvider.java:4058)
                                                     at com.android.providers.telephony.TelephonyProvider.query(TelephonyProvider.java:2724)
                                                     at android.content.ContentProvider.query(ContentProvider.java:1058)
                                                     at android.content.ContentProvider$Transport.query(ContentProvider.java:245)
                                                     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
                                                     at android.os.Binder.execTransact(Binder.java:453)
Run Code Online (Sandbox Code Playgroud)

任何帮助,将不胜感激。

permissions android telephony securityexception android-6.0-marshmallow

3
推荐指数
1
解决办法
8425
查看次数

Java 首选项:无法锁定用户首选项。锁定文件访问被拒绝

我在 Linux 机器上运行 Java Spark 服务器,并且尝试存储用户首选项,但遇到两个主要问题:

  1. 虽然我可以在运行时获取/设置首选项,但每次我终止程序并再次运行它时,首选项都会被删除。

  2. 有时我会收到此错误(这可能与用户同时请求不同的页面有关):

    线程“Timer-0”中出现异常 java.lang.SecurityException:无法锁定用户首选项。锁定文件访问被拒绝。

我的代码如下所示:

...
prefs = Preferences.userRoot().node(PREFS_NAME);
...
get("/sample/reset", (req, res) -> {
    prefs.put("bgimg", "test");
    ...
});
get("/sample/", (req, res) -> {
    String bgImgPath = prefs.get("bgimg",BACKGROUND_IMAGE_PATH);
    ...
});
Run Code Online (Sandbox Code Playgroud)

java linux securityexception preferences apache-spark

3
推荐指数
1
解决办法
7644
查看次数

openInputStream 导致 SecurityException:Permission Denial (Android N+)

我需要帮助解决这个问题,因为我是 Android 新手。

我的应用程序支持JellyBean (16)Oreo (26)

我有一个UploadService需要openInputStream()上传数据,因为牛轧糖中的新行为。

这段代码在 Marshmallow 及以下版本中运行良好,但总是让我SecurityException在 Nougat 上崩溃。它在错误openInputStream()调用的行上崩溃:

java.lang.SecurityException:权限拒绝:从 com.miui.gallery.provider.GalleryOpenProvider uri content://com.miui.gallery.open/raw/%2Fstorage%2Femulated%2F0%2FDCIM%2FCamera%2FIMG_20171008_182pid34.jpg 中读取=30846, uid=10195 需要提供者被导出,或者grantUriPermission()

The file uri could be from various app (gallery, camera, etc). I've narrowed down the problem to uri that comes from ACTION_GET_CONTENT intent (anything that comes from camera intent or MediaRecorder works fine).

I think it's because the uri lost its permission when passed into the …

android securityexception permission-denied android-7.0-nougat

3
推荐指数
1
解决办法
2253
查看次数

(流畅)NHibernate安全例外 - ReflectionPermission

我已经将ASP.Net Web应用程序升级到最新版本的Fluent NHibernate(1.0.0.636)和最新版本的NHibernate(v2.1.2.4000).我已经多次检查过该应用程序是以完全信任的方式运行的.但我不断收到以下错误:

Security Exception
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception …
Run Code Online (Sandbox Code Playgroud)

c# asp.net nhibernate securityexception

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

java.lang.SecurityException:Permission Denial:不允许发送广播android.hardware.usb.action.USB_STATE

我想在设备中安装apk并管理usb状态.

apk向设备发送广播...

Intent intent = new Intent(ACTION_USB_STATE);
sendBroadcast(intent);
Run Code Online (Sandbox Code Playgroud)

在AndroidManifest.xml中,我声明了许可部分..

<uses-permission android:name="android.permission.BROADCAST_STICKY" />
Run Code Online (Sandbox Code Playgroud)

但即使我已经说明了许可,也会出现错误.

日志是......

W/ActivityManager(  850): Permission Denial: not allowed to send broadcast android.hardware.usb.action.USB_STATE from pid=16082, uid=10109
E/AndroidRuntime(16082): FATAL EXCEPTION: main
E/AndroidRuntime(16082): java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.hardware.usb.action.USB_STATE from pid=16082, uid=10109
E/AndroidRuntime(16082):    at android.os.Parcel.readException(Parcel.java:1425)
E/AndroidRuntime(16082):    at android.os.Parcel.readException(Parcel.java:1379)
E/AndroidRuntime(16082):    at android.app.ActivityManagerProxy.broadcastIntent(ActivityManagerNative.java:2098)
E/AndroidRuntime(16082):    at android.app.ContextImpl.sendBroadcast(ContextImpl.java:1003)
E/AndroidRuntime(16082):    at android.content.ContextWrapper.sendBroadcast(ContextWrapper.java:312)
E/AndroidRuntime(16082):    at com.example.usb_mode_change.USBModeSettingActivity$1.onClick(USBModeSettingActivity.java:43)
E/AndroidRuntime(16082):    at android.view.View.performClick(View.java:4101)
E/AndroidRuntime(16082):    at android.view.View$PerformClick.run(View.java:17082)
E/AndroidRuntime(16082):    at android.os.Handler.handleCallback(Handler.java:615)
E/AndroidRuntime(16082):    at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(16082):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(16082):    at android.app.ActivityThread.main(ActivityThread.java:4911) …
Run Code Online (Sandbox Code Playgroud)

permissions android securityexception

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