PDF Plugin Upgrade to 0.4 error

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

PDF Plugin Upgrade to 0.4 error

Marc Dworkin

Hi,

I upgraded my PDF plugin to 0.4, which broke the included Simple PDF Demo.

Selecting the link for http://localhost:8080/MyApp/pdf/demo2?url=/pdf/demo2&filename=document.pdf

Returns an html page and the following logs

--------------------------
BaseUri is http://localhost:8080/MyApp
Fetching url http://localhost:8080/MyApp/pdf/demo2
2009-04-30 22:30:22,311 [7832332@qtp0-4] ERROR service.PdfService  - org.xhtmlrenderer.util.XRRuntimeException: Can't load the XML resource (using TRaX transformer). org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.there was a problem with PDF generation java.lang.NullPointerException: Cannot get property 'length' on null object
--------------------------

Also, from the release notes.  Does "ability to use on secured applications" mean it now works with Jsecurity?

Thanks!

Marc






---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: PDF Plugin Upgrade to 0.4 error

aeischeid
The demo stuff  is kinda sketchy in 1.1, because the views don't show up in the app after installing the plugin. and therefore I don't have good testing of the plugin as installed in a 1.1 app. I will look into this next week as soon as I get time.

it should work for jSecurity (or any other security?) if you use the pdfForm and do method="post" which also requires that you use either template="something" or controller="something" action="someAction". Tags which use a url still don't work with secured views.



On Thu, Apr 30, 2009 at 9:40 PM, Marc Dworkin <[hidden email]> wrote:
Hi,

I upgraded my PDF plugin to 0.4, which broke the included Simple PDF Demo.

Selecting the link for http://localhost:8080/MyApp/pdf/demo2?url=/pdf/demo2&filename=document.pdf

Returns an html page and the following logs

--------------------------
BaseUri is http://localhost:8080/MyApp
Fetching url http://localhost:8080/MyApp/pdf/demo2
2009-04-30
22:30:22,311 [7832332@qtp0-4] ERROR service.PdfService  - org.xhtmlrenderer.util.XRRuntimeException: Can't load the XML resource (using TRaX transformer). org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.there was a problem with PDF generation java.lang.NullPointerException: Cannot get property 'length' on null object
--------------------------

Also, from the release notes.  Does "ability to use on secured applications" mean it now works with Jsecurity?

Thanks!

Marc






---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: PDF Plugin Upgrade to 0.4 error

Marc Dworkin
In reply to this post by Marc Dworkin

Hi Aaron,

Thanks!

Marc

--- On Fri, 5/1/09, Aaron Eischeid <[hidden email]> wrote:

> From: Aaron Eischeid <[hidden email]>
> Subject: Re: [grails-user] PDF Plugin Upgrade to 0.4 error
> To: [hidden email]
> Date: Friday, May 1, 2009, 12:26 PM
> The demo stuff  is kinda sketchy in
> 1.1, because the views don't show up in the app after
> installing the plugin. and therefore I don't have good
> testing of the plugin as installed in a 1.1 app. I will look
> into this next week as soon as I get time.
>
>
> it should work for jSecurity (or any other security?) if
> you use the pdfForm and do method="post" which
> also requires that you use either
> template="something" or
> controller="something"
> action="someAction". Tags which use a url still
> don't work with secured views.
>
>
>
>
> On Thu, Apr 30, 2009 at 9:40 PM,
> Marc Dworkin <[hidden email]>
> wrote:
>
>
> Hi,
>
>
>
> I upgraded my PDF plugin to 0.4, which broke the included
> Simple PDF Demo.
>
>
>
> Selecting the link for http://localhost:8080/MyApp/pdf/demo2?url=/pdf/demo2&filename=document.pdf
>
>
>
> Returns an html page and the following logs
>
>
>
> --------------------------
>
> BaseUri is http://localhost:8080/MyApp
>
> Fetching url http://localhost:8080/MyApp/pdf/demo2
>
> 2009-04-30 22:30:22,311 [7832332@qtp0-4] ERROR
> service.PdfService  -
> org.xhtmlrenderer.util.XRRuntimeException: Can't load
> the XML resource (using TRaX transformer).
> org.xml.sax.SAXParseException: The entity name must
> immediately follow the '&' in the entity
> reference.there was a problem with PDF generation
> java.lang.NullPointerException: Cannot get property
> 'length' on null object
>
>
> --------------------------
>
>
>
> Also, from the release notes.  Does "ability to use
> on secured applications" mean it now works with
> Jsecurity?
>
>
>
> Thanks!
>
>
>
> Marc
>
>
>
>
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
>
> To unsubscribe from this list, please visit:
>
>
>
>     http://xircles.codehaus.org/manage_email
>
>
>
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: PDF Plugin Upgrade to 0.4 error

ldittmar
In reply to this post by aeischeid
I get this error on my application (grails 1.1.1)

BaseUri is http://localhost:8080/test
Fetching url http://localhost:8080/test/test.gsp
2009-06-18 15:49:40,449 [12237125@qtp0-7] ERROR service.PdfService  - org.xhtmlrenderer.util.XRRuntimeException: Can't load the XML resource (using TRaX transformer). java.io.IOException: Stream closed
there was a problem with PDF generation java.lang.NullPointerException: Cannot get property 'length' on null object
FEHLER:  'Stream closed'

What should I do? The only change I made on my app ist on views/myfile.gsp. I inserted:

<g:pdfLink url="/test.gsp" filename="test.pdf" icon="true"/>


grailsOnUbuntu wrote
The demo stuff  is kinda sketchy in 1.1, because the views don't show up in
the app after installing the plugin. and therefore I don't have good testing
of the plugin as installed in a 1.1 app. I will look into this next week as
soon as I get time.

it should work for jSecurity (or any other security?) if you use the pdfForm
and do method="post" which also requires that you use either
template="something" or controller="something" action="someAction". Tags
which use a url still don't work with secured views.



On Thu, Apr 30, 2009 at 9:40 PM, Marc Dworkin <marcvsxiv@yahoo.com> wrote:

> Hi,
>
> I upgraded my PDF plugin to 0.4, which broke the included Simple PDF Demo.
>
> Selecting the link for
> http://localhost:8080/MyApp/pdf/demo2?url=/pdf/demo2&filename=document.pdf
>
> Returns an html page and the following logs
>
> --------------------------
> BaseUri is http://localhost:8080/MyApp
> Fetching url http://localhost:8080/MyApp/pdf/demo2
> 2009-04-30 <http://localhost:8080/MyApp/pdf/demo2%0A2009-04-30>22:30:22,311 [7832332@qtp0-4]
> ERROR service.PdfService  - org.xhtmlrenderer.util.XRRuntimeException: Can't
> load the XML resource (using TRaX transformer).
> org.xml.sax.SAXParseException: The entity name must immediately follow
> the '&' in the entity reference.there was a problem with PDF generation
> java.lang.NullPointerException: Cannot get property 'length' on null object
> --------------------------
>
> Also, from the release notes.  Does "ability to use on secured
> applications" mean it now works with Jsecurity?
>
> Thanks!
>
> Marc
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: PDF Plugin Upgrade to 0.4 error

aeischeid
What kind of stuff is in your test.gsp and what method were you trying to use for the PDF - the pdf link, pdf form etc, method = post or method = get? that sort of thing.

That info should give me some more ideas on how to help.

also, you could try the latest version of the plugin from GitHub. I just haven't had time to move that over to the Grails repos. I know that fixed a bug that I was having with image URL's.

-Aaron

On Thu, Jun 18, 2009 at 8:52 AM, ldittmar <[hidden email]> wrote:

I get this error on my application (grails 1.1.1)

BaseUri is http://localhost:8080/test
Fetching url http://localhost:8080/test/test.gsp
2009-06-18
15:49:40,449 [12237125@qtp0-7] ERROR service.PdfService  -
org.xhtmlrenderer.util.XRRuntimeException: Can't load the XML resource
(using TRaX transformer). java.io.IOException: Stream closed
there was a problem with PDF generation java.lang.NullPointerException:
Cannot get property 'length' on null object
FEHLER:  'Stream closed'

What should I do?



grailsOnUbuntu wrote:
>
> The demo stuff  is kinda sketchy in 1.1, because the views don't show up
> in
> the app after installing the plugin. and therefore I don't have good
> testing
> of the plugin as installed in a 1.1 app. I will look into this next week
> as
> soon as I get time.
>
> it should work for jSecurity (or any other security?) if you use the
> pdfForm
> and do method="post" which also requires that you use either
> template="something" or controller="something" action="someAction". Tags
> which use a url still don't work with secured views.
>
>
>
> On Thu, Apr 30, 2009 at 9:40 PM, Marc Dworkin <[hidden email]> wrote:
>
>> Hi,
>>
>> I upgraded my PDF plugin to 0.4, which broke the included Simple PDF
>> Demo.
>>
>> Selecting the link for
>> http://localhost:8080/MyApp/pdf/demo2?url=/pdf/demo2&filename=document.pdf
>>
>> Returns an html page and the following logs
>>
>> --------------------------
>> BaseUri is http://localhost:8080/MyApp
>> Fetching url http://localhost:8080/MyApp/pdf/demo2
>> 2009-04-30
>> <http://localhost:8080/MyApp/pdf/demo2%0A2009-04-30>22:30:22,311
>> [7832332@qtp0-4]
>> ERROR service.PdfService  - org.xhtmlrenderer.util.XRRuntimeException:
>> Can't
>> load the XML resource (using TRaX transformer).
>> org.xml.sax.SAXParseException: The entity name must immediately follow
>> the '&' in the entity reference.there was a problem with PDF generation
>> java.lang.NullPointerException: Cannot get property 'length' on null
>> object
>> --------------------------
>>
>> Also, from the release notes.  Does "ability to use on secured
>> applications" mean it now works with Jsecurity?
>>
>> Thanks!
>>
>> Marc
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

--
View this message in context: http://www.nabble.com/PDF-Plugin-Upgrade-to-0.4-error-tp23327713p24093413.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: PDF Plugin Upgrade to 0.4 error

ldittmar
I have nothing on test.gsp:

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Sample title</title>
  </head>
  <body>
   

Sample line

    <p>TEST</p>
    <strong>Hallo</strong>
  </body>
</html>

And I use this Link to create a PDF:

<g:pdfLink method="POST" url="/test/PDF.gsp" filename="test.pdf">PDF</g:pdfLink>
grailsOnUbuntu wrote
What kind of stuff is in your test.gsp and what method were you trying to
use for the PDF - the pdf link, pdf form etc, method = post or method = get?
that sort of thing.

That info should give me some more ideas on how to help.

also, you could try the latest version of the plugin from GitHub. I just
haven't had time to move that over to the Grails repos. I know that fixed a
bug that I was having with image URL's.

-Aaron

On Thu, Jun 18, 2009 at 8:52 AM, ldittmar <ldittmar.privat@gmail.com> wrote:

>
> I get this error on my application (grails 1.1.1)
>
> BaseUri is http://localhost:8080/test
> Fetching url http://localhost:8080/test/test.gsp
> 2009-06-18 <http://localhost:8080/test/test.gsp%0A2009-06-18> 15:49:40,449
> [12237125@qtp0-7] ERROR service.PdfService  -
> org.xhtmlrenderer.util.XRRuntimeException: Can't load the XML resource
> (using TRaX transformer). java.io.IOException: Stream closed
> there was a problem with PDF generation java.lang.NullPointerException:
> Cannot get property 'length' on null object
> FEHLER:  'Stream closed'
>
> What should I do?
>
>
>
> grailsOnUbuntu wrote:
> >
> > The demo stuff  is kinda sketchy in 1.1, because the views don't show up
> > in
> > the app after installing the plugin. and therefore I don't have good
> > testing
> > of the plugin as installed in a 1.1 app. I will look into this next week
> > as
> > soon as I get time.
> >
> > it should work for jSecurity (or any other security?) if you use the
> > pdfForm
> > and do method="post" which also requires that you use either
> > template="something" or controller="something" action="someAction". Tags
> > which use a url still don't work with secured views.
> >
> >
> >
> > On Thu, Apr 30, 2009 at 9:40 PM, Marc Dworkin <marcvsxiv@yahoo.com>
> wrote:
> >
> >> Hi,
> >>
> >> I upgraded my PDF plugin to 0.4, which broke the included Simple PDF
> >> Demo.
> >>
> >> Selecting the link for
> >>
> http://localhost:8080/MyApp/pdf/demo2?url=/pdf/demo2&filename=document.pdf
> >>
> >> Returns an html page and the following logs
> >>
> >> --------------------------
> >> BaseUri is http://localhost:8080/MyApp
> >> Fetching url http://localhost:8080/MyApp/pdf/demo2
> >> 2009-04-30
> >> <http://localhost:8080/MyApp/pdf/demo2%0A2009-04-30>22:30:22,311
> >> [7832332@qtp0-4]
> >> ERROR service.PdfService  - org.xhtmlrenderer.util.XRRuntimeException:
> >> Can't
> >> load the XML resource (using TRaX transformer).
> >> org.xml.sax.SAXParseException: The entity name must immediately follow
> >> the '&' in the entity reference.there was a problem with PDF generation
> >> java.lang.NullPointerException: Cannot get property 'length' on null
> >> object
> >> --------------------------
> >>
> >> Also, from the release notes.  Does "ability to use on secured
> >> applications" mean it now works with Jsecurity?
> >>
> >> Thanks!
> >>
> >> Marc
> >>
> >>
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >>    http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/PDF-Plugin-Upgrade-to-0.4-error-tp23327713p24093413.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: PDF Plugin Upgrade to 0.4 error

aeischeid
to start:

<g:pdfLink method="POST" url="/test/PDF.gsp"
filename="test.pdf">PDF</g:pdfLink>

is not a valid usage of the g:pdfLink tag. as of the 0.4 release only method = "get" is available for the link tag


On Mon, Jun 22, 2009 at 6:39 AM, ldittmar <[hidden email]> wrote:

I have nothing on test.gsp:

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>Sample title</title>
 </head>
 <body>
   <h1>Sample line</h1>
   <p>TEST</p>
   <strong>Hallo</strong>
 </body>
</html>

And I use this Link to create a PDF:

<g:pdfLink method="POST" url="/test/PDF.gsp"
filename="test.pdf">PDF</g:pdfLink>

grailsOnUbuntu wrote:
>
> What kind of stuff is in your test.gsp and what method were you trying to
> use for the PDF - the pdf link, pdf form etc, method = post or method =
> get?
> that sort of thing.
>
> That info should give me some more ideas on how to help.
>
> also, you could try the latest version of the plugin from GitHub. I just
> haven't had time to move that over to the Grails repos. I know that fixed
> a
> bug that I was having with image URL's.
>
> -Aaron
>
> On Thu, Jun 18, 2009 at 8:52 AM, ldittmar <[hidden email]>
> wrote:
>
>>
>> I get this error on my application (grails 1.1.1)
>>
>> BaseUri is http://localhost:8080/test
>> Fetching url http://localhost:8080/test/test.gsp
>> 2009-06-18 <http://localhost:8080/test/test.gsp%0A2009-06-18>
>> 15:49:40,449
>> [12237125@qtp0-7] ERROR service.PdfService  -
>> org.xhtmlrenderer.util.XRRuntimeException: Can't load the XML resource
>> (using TRaX transformer). java.io.IOException: Stream closed
>> there was a problem with PDF generation java.lang.NullPointerException:
>> Cannot get property 'length' on null object
>> FEHLER:  'Stream closed'
>>
>> What should I do?
>>
>>
>>
>> grailsOnUbuntu wrote:
>> >
>> > The demo stuff  is kinda sketchy in 1.1, because the views don't show
>> up
>> > in
>> > the app after installing the plugin. and therefore I don't have good
>> > testing
>> > of the plugin as installed in a 1.1 app. I will look into this next
>> week
>> > as
>> > soon as I get time.
>> >
>> > it should work for jSecurity (or any other security?) if you use the
>> > pdfForm
>> > and do method="post" which also requires that you use either
>> > template="something" or controller="something" action="someAction".
>> Tags
>> > which use a url still don't work with secured views.
>> >
>> >
>> >
>> > On Thu, Apr 30, 2009 at 9:40 PM, Marc Dworkin <[hidden email]>
>> wrote:
>> >
>> >> Hi,
>> >>
>> >> I upgraded my PDF plugin to 0.4, which broke the included Simple PDF
>> >> Demo.
>> >>
>> >> Selecting the link for
>> >>
>> http://localhost:8080/MyApp/pdf/demo2?url=/pdf/demo2&filename=document.pdf
>> >>
>> >> Returns an html page and the following logs
>> >>
>> >> --------------------------
>> >> BaseUri is http://localhost:8080/MyApp
>> >> Fetching url http://localhost:8080/MyApp/pdf/demo2
>> >> 2009-04-30
>> >> <http://localhost:8080/MyApp/pdf/demo2%0A2009-04-30>22:30:22,311
>> >> [7832332@qtp0-4]
>> >> ERROR service.PdfService  - org.xhtmlrenderer.util.XRRuntimeException:
>> >> Can't
>> >> load the XML resource (using TRaX transformer).
>> >> org.xml.sax.SAXParseException: The entity name must immediately follow
>> >> the '&' in the entity reference.there was a problem with PDF
>> generation
>> >> java.lang.NullPointerException: Cannot get property 'length' on null
>> >> object
>> >> --------------------------
>> >>
>> >> Also, from the release notes.  Does "ability to use on secured
>> >> applications" mean it now works with Jsecurity?
>> >>
>> >> Thanks!
>> >>
>> >> Marc
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe from this list, please visit:
>> >>
>> >>    http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/PDF-Plugin-Upgrade-to-0.4-error-tp23327713p24093413.html
>> Sent from the grails - user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

--
View this message in context: http://www.nabble.com/PDF-Plugin-Upgrade-to-0.4-error-tp23327713p24145770.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: PDF Plugin Upgrade to 0.4 error

v.ceruti
Hi,

I've just installed the pdf plugin 0.4, the Simple pdf Demo works fine (inserting the following code in a gsp):

<g:pdfForm url="/pdf/demo2" filename="sample.pdf" method="get">
        <input type="hidden" name="name" value="ciao"/>
        <g:submitButton name="printPdf" value="pdfdemo" />
</g:pdfForm>

and I was getting the "famous" error
[67094] service.PdfService org.xhtmlrenderer.util.XRRuntimeException: Can't load the XML resource (using TRaX transformer). org.xml.sax.SAXParseException

when I used a simple gsp of mine instead of the demo.gsp because it uses a layput gsp that was not well formed! The suggestion is to verify validation with an XML validator.

I wish to be usefull...
Reply | Threaded
Open this post in threaded view
|

Re: PDF Plugin Upgrade to 0.4 error

nilsen
the xRender... something is NOT working with SSL (stream closed exception)
this is very very very very sad ... because i want to disable insecure connections completely ...
(stacktrace: http://pastebin.com/a6j9peMr)

Jet
Reply | Threaded
Open this post in threaded view
|

Re: PDF Plugin Upgrade to 0.4 error

Jet
In reply to this post by Marc Dworkin
There is a quick fix.

I am using grails 1.3.4, pdf 0.4, and having the same problem.

The cause of the problem is:

2010-09-03 11:43:34,779 [http-8080-4] ERROR service.PdfService - groovy.lang.MissingMethodException: No signature of method: org.xhtmlrenderer.pdf.ITextRenderer.setDocumentFromString() is applicable for argument types: (org.codehaus.groovy.grails.web.util.StreamCharBuffer) values: [<html><head>

The relevant code needs to be fixed is PdfService.groovy in the pdf plugin folder. The original code was:

renderer.setDocumentFromString(content);

Don't know why the content was not automatically converted itself to String. But we can do:

renderer.setDocumentFromString(content.readAsString());

Hope this helps and be included in the next pdf plugin upgrade.