users@glassfish.java.net

Re: IllegalArgumentException: "timers" / OldTypesBase.oldObjectNameToJ2EEType

From: jsexton0 <jsexton0_at_gmail.com>
Date: Tue, 11 Nov 2008 07:51:54 -0800 (PST)

Hello -
Sorry, I was using the web forum and forgot that it's a mailing list.

java.lang.IllegalArgumentException: "timers"
com.sun.enterprise.management.support.OldTypesBase.oldObjectNameToJ2EEType(OldTypesBase.java:153)
com.sun.enterprise.management.support.oldconfig.OldProps.<init>(OldProps.java:187)
com.sun.enterprise.management.support.LoaderOfOldMonitor.oldToNewObjectName(LoaderOfOldMonitor.java:265)
com.sun.enterprise.management.support.LoaderOfOld.syncWithOld(LoaderOfOld.java:415)
com.sun.enterprise.management.support.Loader._sync(Loader.java:548)
com.sun.enterprise.management.support.Loader.sync(Loader.java:522)
com.sun.enterprise.management.support.Loader.handleMBeanRegistered(Loader.java:209)
com.sun.enterprise.management.support.LoaderRegThread.processRegistration(LoaderRegThread.java:204)
com.sun.enterprise.management.support.LoaderRegThread.process(LoaderRegThread.java:253)
com.sun.enterprise.management.support.LoaderRegThread.run(LoaderRegThread.java:154)

Product Version: NetBeans IDE 6.1 (Build 200805300101)
Java: 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: E:\openesb\.netbeans\openesb

glassfish-v2-ur2-b04-patch-20080729

This seems to happen whenever something implementing TimedObject is
deployed.
I found 2 or 3 other posts in various places noting this, all quite recent.

I've also not been able to start a timer that has been included in an EJB.
I've read that this has to be done from a servlet? This is all surprisingly
awkward. Is there an example online someplace? It there another way that
is more in keeping with the way Glassfish/OpenESB is intended to be used?
I'm on a short time frame for this, and I have written timers for a servlet
environment (Tomcat) simply using threads in the past. Maybe I should just
do it that way and be done with it?

Thank you


Marina Vatkina 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
>
>
>

-- 
View this message in context: http://www.nabble.com/IllegalArgumentException%3A-%22timers%22---OldTypesBase.oldObjectNameToJ2EEType-tp19918950p20442327.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.