Re: ERPDFGeneration problem & best practices
Re: ERPDFGeneration problem & best practices
- Subject: Re: ERPDFGeneration problem & best practices
- From: Tim Worman <email@hidden>
- Date: Sun, 23 Sep 2012 19:09:22 -0700
On Sep 23, 2012, at 6:24 PM, Q <email@hidden> wrote:
>
> On 24/09/2012, at 10:21 AM, Tim Worman <email@hidden> wrote:
>
>> On Sep 21, 2012, at 5:50 PM, Q <email@hidden> wrote:
>>
>>>
>>> On 22/09/2012, at 6:26 AM, Tim Worman <email@hidden> wrote:
>>>
>>>> All:
>>>>
>>>> My app is attempting to attach a PDF to an email and I'm getting a failure. The only response is:
>>>>
>>>> "Your request produced an error."
>>>>
>>>> The code below works fine in development but fails in deployment. I'm using ERJavaMail for sending.
>>>>
>>>> There is no stack trace, etc. My attempt to produce my PDF seems to stop at the constructor for FlyingSaucerImpl since no console messages I've placed in the code are seen after that.
>>>>
>>>> public void sendEmail() {
>>>> GSEISPersonAccountInfoComponent acctPdf = (GSEISPersonAccountInfoComponent)pageWithName(GSEISPersonAccountInfoComponent.class.getName());
>>>> acctPdf.setAPerson(aPerson()); //create PDFWrapper component
>>>> NSLog.out.appendln("making pdf");
>>>> NSData pdf = acctPdf.generateResponse().content(); //get the PDF data
>>>> ERMailDeliveryHTML mail = new ERMailDeliveryHTML();
>>>
>>> ^^^^^^^^^^^^^^^^^^
>>>
>>> Does it get this far?
>>>
>>> If not, try wrapping it in a try { .. } catch (Throwable e) { log.error(e); throw e; } block and log out the error. You may be swallowing the exception somewhere higher up the stack, or it's logging out to somewhere you aren't seeing in deployment.
>>
>> Very mysterious - but I can't get any errors to throw at all. I tried the approach above. I'm gonna try some other things today and hopefully make some progress. It's killing me though that I can't get any failure/exception messages. If it were logging out somewhere else, I'm not sure where that would be.
>>
>
> Are you catching Throwable or Exception, and did you wrap everything in the try block? The only reason for you to see your first log message but not your second is because an exception is being thrown somewhere between the two. If you catch Throwable you will intercept it, if you catch Exception you won't.
>
> If I were to take a wild guess at the cause of your problem the most likely explanation would be invalid XML data being generated by your component page, possibly an unescaped &, < or > character in some data you are using in production but not in development.
The invalid XML was what I assumed too - so I started simplifying my PDF. Which didn't yield results. What I found was what I normally find - that I'm a moron. I had my own PDF solution and in my core framework I had an older version of the iText on the classpath - it's literally been there for years. This was the source of the issues. Man, that was tough to solve - and I'm too happy to be upset at the time lost. That really bit me hard south of the spinal column.
Wonderizing apps can sometimes cause pain - if you're a moron.
Thanks much Q and all for your assistance.
Tim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden