opensagres / xdocreport

XDocReport means XML Document reporting. It's Java API to merge XML document created with MS Office (docx) or OpenOffice (odt), LibreOffice (odt) with a Java model to generate report and convert it if you need to another format (PDF, XHTML...).
https://github.com/opensagres/xdocreport
1.22k stars 372 forks source link

Opening template in gae #282

Open lvalladares opened 6 years ago

lvalladares commented 6 years ago

So, im trying to open the template in GAE (Java 7) using the following code:

IXDocReport report = XDocReportRegistry.getRegistry().loadReport(in, TemplateEngineKind.Freemarker);

in is an InputStream with some .docx report readed from the cloud.

When i do this i get the following error in that line:

java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")

I've been searching about this in the wiki and issues and i cant find anything, im not using maven so i've manually imported the followings jars from maven webpage (downloaded and the imported)

I dont know if im missing some jars, so any help or indication you can give will be great!

Thanks!


Update: The issues appears to be related with the Timer class because the error is given by this line:

https://github.com/opensagres/xdocreport/blob/e1b291914392f936e5a59e1b9a64399df2d4941d/document/fr.opensagres.xdocreport.document/src/main/java/fr/opensagres/xdocreport/document/registry/XDocReportRegistry.java#L84

So, i suspect this is related with GAE Threading limitations and the way Timer works.

lvalladares commented 6 years ago

I managed to solve this downgrading to 1.0.6. The version 2 is not compatible with GAE because the threading changes. Also the converters arent compatibles with gae no matter what plugins you install, they try to use the awt java lib. This isnt allowed in GAE, so it raises an exception.

I'll keep this issue open in order to track this.

angelozerr commented 6 years ago

@pascalleclercq could you see this issue please. Do you remember why you are using cleapTimer? Do you think we could remove it? Thanks!

angelozerr commented 6 years ago

@lvalladares could you tell me if https://github.com/opensagres/xdocreport/commit/ddbb103311490fb52d2bc770d6ee3268ffb3939f fixes your problem? Thanks!