Q:

It terminates right after logging out "making pdf" and when trying to capture 
the PDF component as NSData.

I'll try what you suggested. What's also odd is that it runs great in 
development - with the only odd thing I see there that after this process there 
is a message in the console about creating more worker threads.

Tim

On Sep 21, 2012, at 5:50 PM, Q <[email protected]> wrote:

> 
> On 22/09/2012, at 6:26 AM, Tim Worman <[email protected]> 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.
> 
>>       try {
>>         mail.newMail();
>>         mail.setFromAddress("[email protected]");
>>         mail.setReplyToAddress("[email protected]");
>>         mail.setSubject("GSE&IS Account Info");
>>         mail.setComponent(this);  //send this component as a new component 
>> based email
>>         mail.setToAddresses(new NSArray (aPerson().emailAddress()));
>>         //attach PDF to email
>>         NSLog.out.appendln("this is where I want to attach pdf"); //never 
>> get here
>>         mail.addAttachment(new 
>> ERMailDataAttachment(acctPdf.pdfFilename(),null,pdf));
>>         mail.sendMail();
>>       } catch (Exception e) {
>>         e.printStackTrace();
>>       }
>>     }
>> 
>> This code is in my "emailed" component so it sets itself as the body of a 
>> new email - then tries to attach a PDF generated with ERPDFWrapper. This is 
>> called from a DirectAction. I'm not returning either the PDF or the email 
>> component to the browser. Am I violating best practices by trying to use the 
>> PDF wrapper without returning it?
>> 
>> Tim
>> UCLA GSE&IS
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/qdolan%40gmail.com
>> 
>> This email sent to [email protected]
> 


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to