I'm using Seam 2.0 BETA. Here is fragment of my code:
This method triggers action for sending e-mail:

  | 
  |      @Asynchronous
  |      @Transactional
  |     public QuartzTriggerHandle schedule( @Expiration Date when, 
@IntervalDuration Long min){                 
  |                             for(Order order:orderService.getAllOrders()){
  |                                     
if(orderService.getOrderForMailing(order)!=null){
  |                                             
messageAction.sendOrderEmailToBuyer(order);
  |                                     }
  |                             }
  |     
  |             return null;
  |     }
  | 
  |     

And this method  sending e-mail.


  | public void sendOrderEmailToBuyer(Order order) {
  |             try {
  |                     User buyer = order.getBuyer();
  |                     Contexts.getConversationContext().set("currentOrder", 
order);
  |                     
Contexts.getConversationContext().remove("currentOrderItems");
  |                     Contexts.getConversationContext().set("recipient", 
buyer);
  |                     Contexts.getConversationContext().set("changedstatus", 
chandedstatus);
  |                     
  |                     log.info("Email was sent successfuly to %1", 
buyer.getEmail());
  |             } catch (Exception e) {
  |                     e.printStackTrace();
  |                     log.error("ERROR while sending e-mail", e);
  |             }
  |     }

Method sendOrderEmailToBuyer works fine when  I clicked  on button 
directly.Problem is when  quartz action triggered this method for sending mail 
it trows error  which I post above.Info:Quartz class starts when server starts.

Tnx,
mb

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4075933#4075933

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4075933
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to