Using EJB Timer Service in GlassFish V3 Prelude

This is a followup to the previous entry Using EJB Timers in GlassFish V3 TP2


All steps described in that blog apply, with the exception that the war file name and location had slightly changed to be <your-installtion>/glassfish/lib/install/applications/ejb-timer-service-app.war (Note that there is now no version present in the name of the war archive).


With V3 Prelude you can now use the EJB Timer Service with the Embedded JavaDB database, as had been available in all prior releases of GlassFish and Sun Application server.
To do so, just install JTS package from the Update Center and restart the server. You need JTS support because the __TimerPool is configured to use XA resources.


As always send us questions or comments to users@glassfish.dev.java.net or dev@glassfish.dev.java.net

Comments:

Can u explain why we need do so if we can use standart timer service? just after i set my glassfish i can deploy my application with timers and it will work fine? what advantage give this module?

Posted by Timur on December 20, 2008 at 12:11 AM PST #

Are you using GlassFish V2? If yes, EJB Timer Service is available there out-of-the-box. Description above applies to GlassFish V3 Prelude, where EJB and the EJB Timer Service are available only with some extra steps.

Posted by Marina on January 06, 2009 at 06:04 AM PST #

I'm using Sun Java System Application Server 9.1_02 (build b04-fcs)
glassfish-installer-v2ur2-b04-linux.jar

this distribution allow using timers just after installation

@Resource
TimerService timerService;

...
timerService.createTimer(interval, interval, null);
...

@Timeout
public void iterate(Timer timer) {
...

Posted by Temir on January 07, 2009 at 11:29 AM PST #

Hi..

I am using Glassfish v2.1. Do you have any examples of how I can use the EJB Timer Service? I can't find any relevant documentation or examples.

Thanks.

Posted by Masrudyn on June 23, 2009 at 02:07 AM PDT #

Did you look at Java EE Tutorial? There is a section on EJB Timer Service: http://java.sun.com/javaee/5/docs/tutorial/doc/bnboy.html

Posted by Marina Vatkina on June 23, 2009 at 08:48 AM PDT #

Hi,

I have Glassfish Enterprise Server and I have created a cluster in it, I have configured all the things, like connection pool for our database and for timerservice (timerdb1 is databasename and EJB__TIMER_TBL is table name), also configured the JNDI name in EJB Container > ENB Serive, but when i deployed my application on that, it gives me error like below
javax.ejb.EJBException : EJB timer service is not available

anybody have any idea about this?

Regards,
Kartik

Posted by Kartik on November 06, 2009 at 12:45 AM PST #

Did you check that the datasource that you are using is enabled in the cluster?

Posted by Marina Vatkina on November 09, 2009 at 06:10 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Marina Vatkina

Search

Top Tags
Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
News

No bookmarks in folder

Blogroll
Related Links