users@glassfish.java.net

Is it possible to test code using TimeService within Junit?

From: <glassfish_at_javadesktop.org>
Date: Fri, 23 Jul 2010 06:44:12 PDT

I'm relatively new to Glassfish development. I am having problems running the TimerService withing an embeddable container. From everything I could find online, it appears that Glassfish does support this?

When I run a JUnit test that has a bean that utilizes the TImerServer, I get the following error:

Jul 23, 2010 9:27:59 AM com.sun.ejb.containers.EjbContainerUtilImpl deployEJBTimerService
INFO: Loading EJBTimerService. Please wait.
Jul 23, 2010 9:27:59 AM com.sun.ejb.containers.EjbContainerUtilImpl deployEJBTimerService
WARNING: Cannot deploy or load EJBTimerService: required WAR file (ejb-timer-service-app.war) is not installed
Jul 23, 2010 9:27:59 AM com.sun.ejb.containers.BaseContainer initializeHome
INFO: Portable JNDI names for EJB Scheduler : [java:global/ejb-app3441497495835793366/classes/Scheduler!com.lmco.scheduler.Scheduler, java:global/ejb-app3441497495835793366/classes/Scheduler]
Jul 23, 2010 9:28:00 AM com.sun.ejb.containers.BaseContainer initializeHome
Jul 23, 2010 8:49:04 AM com.sun.ejb.containers.EjbContainerUtilImpl deployEJBTimerService
INFO: Loading EJBTimerService. Please wait.
Jul 23, 2010 8:49:04 AM com.sun.ejb.containers.EjbContainerUtilImpl deployEJBTimerService
WARNING: Cannot deploy or load EJBTimerService: required WAR file (ejb-timer-service-app.war) is not installed
Jul 23, 2010 8:49:04 AM com.sun.ejb.containers.BaseContainer initializeHome

I've spent some time trying to get this to work, and am out of ideas. Other forum posts suggest including glassfish-embedded-static-shell.jar , but Netbeans automatically added this to the Junit classpath for me. I'd at least like to know if it is possible to test code that uses Timer Service using the embedded container before I spend more time trying to get this to work.

Any help would be greatly appreciated.
[Message sent by forum member 'cebert']

http://forums.java.net/jive/thread.jspa?messageID=478395