appengine错误 - java.security.AccessControlException:访问被拒绝(" java.lang.RuntimePermission"" accessClassInPackage.com.sun.org.apache.xerces [英] appengine error - java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.com.sun.org.apache.xerces

查看:108
本文介绍了appengine错误 - java.security.AccessControlException:访问被拒绝(" java.lang.RuntimePermission"" accessClassInPackage.com.sun.org.apache.xerces的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我重新部署了我的应用程序(google appengine),它似乎工作正常,但是当我尝试解析Xml时,得到:
java.security.AccessControlException:access denied(java.lang.RuntimePermission accessClassInPackage.com.sun.org.apache.xerces.internal.parsers)



这是什么意思?和我如何解决它?



在应用程序的以前版本中,我没有得到这个错误。



在本地运行应用程序时,我不会收到此错误。



我做了一些小改动 - 我将一些数据从用户界面传递到数据存储区



以下是解析XML的代码:

  public static< T extends BaseDataObject> T xml2Bean(Class< T> clazz,
String xmlData)抛出UnsupportedEncodingException,JAXBException {
Reader reader = new StringReader(xmlData);
JAXBContext context = getContext(clazz);
Unmarshaller um = context.createUnmarshaller();
return(T)um.unmarshal(reader);
}

我的猜测是Google用来支持 com。 sun.org.apache.xerces.internal.parsers 但现在他们不这样做,而且我的旧代码仍然可以工作,因为它仍然被支持时被推送...



我如何验证这个猜测?即我在哪里可以找到不支持的软件包列表?



我在考虑删除XML代码并使用json,我怎样才能确保支持json? / b>解决方案问题已解决:我已下载xerces并将jar添加到war \WEB-INF\lib和在eclipse中构建路径。



我也升级到最新的JDK(java 7)。



我是不知道哪些人解决了这个问题......


I re-deployed my app (google appengine), it seems to be working fine, but when I try to parse Xml I get: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.com.sun.org.apache.xerces.internal.parsers")

what does it mean? and how I can solve it?

on previous version of the app I didn't got this error.

when running the app locally I don't get this error.

I made minor changes - I pass some data from the UI to the datastore

Here is the code that parse the XML:

public static <T extends BaseDataObject> T xml2Bean(Class<T> clazz,
        String xmlData) throws UnsupportedEncodingException, JAXBException {
    Reader reader = new StringReader(xmlData);
    JAXBContext context = getContext(clazz);
    Unmarshaller um = context.createUnmarshaller();
    return (T) um.unmarshal(reader);
}

My guess is that Google use to support com.sun.org.apache.xerces.internal.parsers but now they don't, and my old code still working because it was pushed when it was still supported...

how can I verify this guess? i.e. where can I find the list of unsupported packages?

I'm thinking of dropping the XML code and use json instead, how can I make sure json is supported?

解决方案

Problem was solved: I've downloaded xerces and added the jars to war\WEB-INF\lib and to the build path in eclipse.

I also upgrade to the latest JDK (java 7).

I'm not sure which of those solved the problem...

这篇关于appengine错误 - java.security.AccessControlException:访问被拒绝(&quot; java.lang.RuntimePermission&quot;&quot; accessClassInPackage.com.sun.org.apache.xerces的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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