Closed GoogleCodeExporter closed 9 years ago
If I use the original itext-2.1.7, the error is different:
Caused by: java.lang.NoClassDefFoundError: java.awt.Color is a restricted
class. Please see the Google App Engine developer's guide for more details.
at java.awt.Color.<clinit>(Color.java)
at
org.odftoolkit.odfdom.converter.pdf.internal.ColorRegistry.createColor(ColorRegi
stry.java:47)
Original comment by rco...@ciandt.com
on 19 Dec 2012 at 11:24
Hi,
If I understand the gae patch, it uses a custom java.axt.Color with
com.lowagie.text.awt.Color. The big problem with that is that itext-2.1.7.jar
will not work if we create our own Color class.
I don't know how we could manage both itext-2.1.7-gae.jar and itext-2.1.7.jar
(perhaps with Java reflection).
Just for your information, you can use report.convert to generate report and
convert it (it uses internally PdfConverter)
Regards Angelo
Original comment by angelo.z...@gmail.com
on 19 Dec 2012 at 1:36
Hi Angelo,
I'm using only one itext.jar per time. But actually I only have
itext-2.1.7-gae.jar in WEB-INF/lib.
I tried report.convert but the same error occurs.
Options options =
Options.getTo(ConverterTypeTo.PDF).via(ConverterTypeVia.ODFDOM);
report.convert(context, options, out);
I guess the error is when ColorRegistry is loaded. It imports java.awt.Color
and uses the decode method in that line.
Regards
Original comment by rco...@ciandt.com
on 19 Dec 2012 at 2:05
I got the com.lowagie.text.awt files from the gae patch and changed to the
desired com.google.apphosting.runtime.security.shared.stub.java.awt in my app.
Looks like ColorRegistry.java:47 tried to call the static method, perhaps the
"alternative" Color class was loaded correctly.
Original comment by rco...@ciandt.com
on 19 Dec 2012 at 2:09
Attachments:
> I tried report.convert but the same error occurs.
Yes it's normal, it uses PdfConverter. As you said, problem is to use
java.awt.Color, but I think it's very hard to manage both java.awt.Color and
com.lowagie.text.awt.Color
I would like to avoid 2 version of the converter, just to change package name
"java.awt" to "com.lowagie.text.awt" in our classes.
I think reflection could be a solution, but I don't know if it will be easy to
do that?
Regards Angelo
Original comment by angelo.z...@gmail.com
on 19 Dec 2012 at 2:13
It seems that ODFDOM has some dependencies to java.awt.Color in some classes,
but perhaps we don't use it for our converter. Could you test if you can load
ODT with OdfTextDocument document = OdfTextDocument.loadDocument(inputStream)
and save it to your http response to check you have none problem, please.
If you have problem with java.awt.Color, we cannot do nothing. Before studying
how to replace java.awt.Color with our custom Color clases, I would know if
ODFDOM can be used with GAE.
Thankr's for your help.
Regards Angelo
Original comment by angelo.z...@gmail.com
on 21 Dec 2012 at 10:33
Hi Angelo,
Yes, I can open an ODT file using OdfTextDocument document =
OdfTextDocument.loadDocument(inputStream), change some parameters using
report.createContext(), and if I use report.process(context,
((HttpServletResponse) resp).getOutputStream()) the ODT is downloaded with the
parameters changed as expected.
Regards
Original comment by rco...@ciandt.com
on 21 Dec 2012 at 10:46
Have you tried google drive to do your conversion ? Remember you need a license
to use iText, even when your only offering a service, because itext is licensed
with AGPL (http://en.wikipedia.org/wiki/Affero_General_Public_License)
Original comment by k...@koma.be
on 28 Dec 2012 at 7:02
Our PDF converter uses iText 2.1.7 which is licensed with MPL.
Original comment by angelo.z...@gmail.com
on 29 Dec 2012 at 12:09
Hi,
I have created several project with *-gae extension (not commited for the
moment) which (I hope) supports GAE
for that I have copy/paste our Java code converter and replace java.awt.Color
with com.lowagie.text.awt.Color.
I had to modify itext-gae source code to avoid the StackOverFlow
(StackOverflowError at com.lowagie.text.pdf.RandomAccessFileOrArray.seek)
problem described in the
http://code.google.com/p/xdocreport/issues/detail?id=197
I have attached 3 JARs, could you test it please :
* use itext-gae-1.0.1-SNAPSHOT.jar instead of itext-gae.jar
* use org.odftoolkit.odfdom.converter.pdf-gae-1.0.1-SNAPSHOT.jar instead of org.odftoolkit.odfdom.converter.pdf.jar
* use fr.opensagres.xdocreport.itext.extension-gae-1.0.1-SNAPSHOT.jar instead of org.odftoolkit.odfdom.converter.pdf.jar
It works for me with simple Java Main but I don't know with GAE context (I'm
afraid that it doesn't work, because I have replaced RandomAccessFileOrArray
from itext-gae with RandomAccessFileOrArray from itext).
Many thank's for your help.
Regards Angelo
Original comment by angelo.z...@gmail.com
on 2 Jan 2013 at 10:24
Attachments:
Hi,
I have commited my work on Git (see projects nammed with *-gae at
http://code.google.com/p/xdocreport/source/browse/thirdparties-extension/)
It will be available soon on maven central with SNAPSHOT.
I'm waiting for your test on GAE with the attached JARs.
Regards Angelo
Original comment by angelo.z...@gmail.com
on 3 Jan 2013 at 10:46
Pascal has developed a demo on Google App Engine with XDocReport converters and
it works great. So you must use the new *-gae project converters. Please read
http://code.google.com/p/xdocreport/wiki/XDocReportGAE for more information.
Original comment by angelo.z...@gmail.com
on 7 Jan 2013 at 1:09
XDocReport 1.0.1 supports now Google App Engine with new *-gae projects
converters.
Original comment by angelo.z...@gmail.com
on 7 Jan 2013 at 1:10
Great news Angelo ! I'll try it and let you know.
BR
Original comment by rco...@ciandt.com
on 8 Jan 2013 at 10:21
Original issue reported on code.google.com by
rco...@ciandt.com
on 19 Dec 2012 at 11:21Attachments: