users@glassfish.java.net

EJB 3.1 _at_Schedule annotated methods failing to fire on GFv3 server restart

From: <glassfish_at_javadesktop.org>
Date: Tue, 07 Sep 2010 13:07:03 PDT

I have two POJOs annotated with @Startup and @Singleton. One of them also has a @DependsOn annotation that sets up a startup dependency on the other one so that it will start after the other one starts. Each POJO has a method that is annotated with @Schedule.

Sometimes, not always, after restarting GFv3 (build 74.2 on Windows with JDK 1.6.0_20) the methods annotated with @Schedule never and I mean never fire.

One of them is annotated so that it should fire once per second:

@Schedule(second = "0-59", minute = "0-59", hour = "0-23", info="ssrQueueScheduledTimer", persistent=true)
@Lock(javax.ejb.LockType.WRITE)

The POJO containing that method also is the one that depends on the startup of the other POJO.

The other POJO has one method annotated like so:

@Schedule(second = "0,5,10,15,20,25,30,35,40,45,50,55", minute = "0-59", hour = "0-23", persistent=true, info="snussTimer" )

The usage of the different forms of specifying the seconds was an experiment on my part to see if the form of specifying the seconds would make a difference. Both forms are valid so it should not and it doesn't seem to have any bearing. Also specifying persistent=true was also an experiment on my part as that is true by default, however that didn't help either.

Once things get in this state no amount of restarting the GF service will cause these timers to fire when they should. The only way to fix things is to undeploy and redeploy the web app.

There are no application related exceptions in the server.log or the application's own logs.

The only exception is the following from the server log:

[#|2010-09-06T18:54:22.538-0400|SEVERE|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=11;_ThreadName=Thread-1;|log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.|#]

There are also several dependency_failed messages in the jvm.log. An example of one looks like this:

<dependency_failed type='unique_concrete_method' x='java/util/ArrayList add (Ljava/lang/Object;)Z' witness='javax/management/AttributeList' stamp='4.567'/>

These dependency_failed messages show up on GF startup with or without any deployed applications and have been posted about in the forum in the past but have not gathered any responses.

Thoughts? Thanks,

-Noah
[Message sent by forum member 'emailnbw']

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