users@glassfish.java.net

Re: IllegalArgumentException: "timers" / OldTypesBase.oldObjectNameToJ2EEType

From: Abhijit Kumar <Abhijit.Kumar_at_Sun.COM>
Date: Tue, 11 Nov 2008 07:43:49 -0800

Hi Nazrul,

Can Sreeni or Prashanth help with this?

Abhijit

On Nov 10, 2008, at 3:07 PM, Marina Vatkina <Marina.Vatkina_at_Sun.COM>
wrote:

> Can you post the complete stack trace and GF version?
>
> thanks,
> -marina
>
> jsexton0 wrote:
>> Today I tried a trivial timed object, that never fires. I also get
>> this very
>> error (java.lang.IllegalArgumentException: "timers") Any ideas
>> anyone?
>> Here's a trivial timer, which does not work:
>> import java.util.Date;
>> import java.util.logging.Logger;
>> import javax.ejb.Timer;
>> import javax.ejb.SessionContext;
>> import javax.ejb.Stateless;
>> import javax.ejb.TimedObject;
>> import javax.ejb.TimerHandle;
>> import javax.ejb.TimerService;
>> @Stateless
>> public class CMSTimerBean implements TimedObject {
>> private SessionContext sc;
>> private TimerHandle timerHandle = null;
>> public void ejbTimeout(javax.ejb.Timer arg0) {
>> java.util.logging.Logger.getLogger(getClass().getName()).log(
>> java.util.logging.Level.INFO,
>> "Tick");
>> }
>> public void ejbPostCreate() {
>> Date now = new Date();
>> initializeTimer(now, 30000, "CMS_TIMER");
>> }
>> public void initializeTimer(Date firstDate, long timeout, String
>> timerName) {
>> try {
>> TimerService ts = sc.getTimerService();
>> Timer timer = ts.createTimer(firstDate, timeout,
>> timerName);
>> timerHandle = timer.getHandle();
>> } catch (Exception e) {
>> e.printStackTrace();
>> }
>> }
>> public void setSessionContext(SessionContext ctx) {
>> sc = ctx;
>> }
>> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>