[jboss-user] [JBoss Seam] - Re: problem with messages in scheduler.

Stateless Bean do-not-reply at jboss.com
Tue May 8 03:45:18 EDT 2007


Hi Pete!
Until my problem still exist, i made some check;

1. Downloaded newer seam version 1.2.1GA
2. Create in eclipse new project "seampay" like in examples.
3. Copied from your examples/seampay/src classes and modified:
Processor and conroler like here:

Controler

  | 	@In 
  | 	protected Map<String, String> messages; //MY MESSAGES Instance
  | 
  |     public String saveAndSchedule()
  |     {
  |         String locale = messages.get("login.password");
  |         System.out.println("CONTROLER: " + locale);  //here shoudl be "blabla,bleble, bububububu" and stil is login.password"
  |         String result = persist();
  |         
  |         Payment payment = getInstance();
  |         log.info("scheduling instance #0", payment);
  | 
  |         Timer timer = processor.schedulePayment(payment.getPaymentDate(), 
  |                                                 payment.getPaymentFrequency().getInterval(), 
  |                                                 payment);
  |         
  |         payment.setTimerHandle( timer.getHandle() );
  | 
  |         return result;
  |     }
  | 

Processor

  | 	@In 
  | 	protected Map<String, String> messages;
  | 
  |     @Asynchronous
  |     @Transactional
  |     public Timer schedulePayment(@Expiration Date when, 
  |                                  @IntervalDuration long interval, 
  |                                  Payment payment) 
  |     { 
  |         payment = entityManager.merge(payment);
  |         String locale = messages.get("login.password");
  |         System.out.println("LOCALE: " + locale); //and here again
  |         log.info("[#0] Processing payment #1", System.currentTimeMillis(), payment.getId());
  |         log.info("Timer handle is #0", payment.getTimerHandle());
  | 
  |         if (payment.getActive()) {
  |             BigDecimal balance = payment.getAccount().adjustBalance(payment.getAmount().negate());
  |             log.info(":: balance is now #0", balance);
  |             payment.setLastPaid(new Date());
  | 
  |             if (payment.getPaymentFrequency().equals(Payment.Frequency.ONCE)) {
  |                 payment.setActive(false);
  |             }
  |         }
  | 
  |         return null;
  |     }
  | 

and modified faces-config.xml by adding 


  |   <application>
  | 		<message-bundle>messages</message-bundle>
  | 		<locale-config>
  | 			<default-locale>en</default-locale>
  | 			<supported-locale>en</supported-locale>
  | 		</locale-config>
  | 	</application>
  | 

and also copied my messages file to 

  | jboss-seam-pay.jar/messages-en.properties
  | 


  | login.password = blabla,bleble, bububububu
  | 

all copied back into ear file and started on jboss 4.0.5 AS,

Problem is same as like in my app, i get "login.password" not "blabla...etc"
why?
Can anyone check this and tell me what i'm going wrong?
Maybe this is bug?

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043840



More information about the jboss-user mailing list