This content has been marked as final.
Show 4 replies
-
1. Re: problem with messages in scheduler.
statelessbean May 7, 2007 4:14 AM (in response to statelessbean)there shoudl be:
messages.ge("myText");
get(..), i made mistake in post, but problem still exist in cource code i have get() -
2. Re: problem with messages in scheduler.
pmuir May 7, 2007 4:37 AM (in response to statelessbean)where is the messages.properties being packaged to in your ear?
-
3. Re: problem with messages in scheduler.
statelessbean May 7, 2007 7:00 AM (in response to statelessbean)"petemuir" wrote:
where is the messages.properties being packaged to in your ear?
myProject - project namemyProject.ear/myProject.jar/messages_en.properties
-
4. Re: problem with messages in scheduler.
statelessbean May 8, 2007 3:45 AM (in response to statelessbean)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 tojboss-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?