• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
ERPDFGeneration problem & best practices
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ERPDFGeneration problem & best practices


  • Subject: ERPDFGeneration problem & best practices
  • From: Tim Worman <email@hidden>
  • Date: Fri, 21 Sep 2012 13:26:10 -0700

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();

      try {
        mail.newMail();
        mail.setFromAddress("email@hidden");
        mail.setReplyToAddress("email@hidden");
        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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: ERPDFGeneration problem & best practices
      • From: Q <email@hidden>
    • Re: ERPDFGeneration problem & best practices
      • From: Amedeo Mantica <email@hidden>
  • Prev by Date: Re: Inappropriate OGNL expression !
  • Next by Date: Re: ERPDFGeneration problem & best practices
  • Previous by thread: Re: Inappropriate OGNL expression !
  • Next by thread: Re: ERPDFGeneration problem & best practices
  • Index(es):
    • Date
    • Thread