Elia Weiss
Elia Weiss

Reputation: 10040

appengine error - java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.com.sun.org.apache.xerces

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?

Upvotes: 1

Views: 1348

Answers (2)

Elia Weiss
Elia Weiss

Reputation: 10040

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...

Upvotes: 2

Robin Green
Robin Green

Reputation: 33103

Something in your code or a dependency of your code, is trying to refer to the package com.sun.org.apache.xerces.internal.parsers, which is not allowed on GAE. Just a guess: maybe a dependency has been upgraded and this dependency is trying to access that package.

Upvotes: 0

Related Questions