SaveToZipFile saver = new SaveToZipFile(wordMLPackage);
try {
saver.save( response.getOutputStream() );
} catch (Docx4JException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Somewhere in save(response.getOutputStream()) it accesses something which causes:
- Code: Select all
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.com.sun.xml.internal.bind.marshaller)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:166)
at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1512)
at java.lang.ClassLoader$1.run(ClassLoader.java:331)
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.ClassLoader.checkPackageAccess(ClassLoader.java:329)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:176)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.docx4j.jaxb.NamespacePrefixMapperUtils.getPrefixMapper(NamespacePrefixMapperUtils.java:47)
at org.docx4j.openpackaging.contenttype.ContentTypeManager.marshal(ContentTypeManager.java:738)
at org.docx4j.openpackaging.io.SaveToZipFile.save(SaveToZipFile.java:139)
According to the GWT forums, this error means I'm trying to access a class that is not allowed while running on GAE - where this app will be hosted eventually.
Questions:
1. Is my analysis correct? Anyone have docx4j working on GAE?
2. Is there any way to modify the code to make it GAE compliant - ideas? Notice that the location of the error is org.docx4j.jaxb.Namespace... and jaxb is whitelisted.
3. I'm using the Java 6 'built in' JAXB, not the RI. There are some posts from a year ago that RI 2.2 doesn't work and you need to go back to RI 2.1.x. How can I specify which JAXB version to use from within docx4j?
Thanks in advance!
Rob