0 Replies Latest reply on Nov 12, 2008 3:38 AM by kesson

    Timed functions

    kesson

      Hello all,

      We have an application running on JBoss -4.2.1GA, and there is some method annotated as @Timeout. In other words, we have defined a timer in the application, and it invokes this method in timely manner. The timed method initializes some action, which needs to use external scripting engine. This is the Groovy, for instance. There is a control element in GUI, that allows to activate/deactivate the timer. Actually, activation creates a new instance of the timer, while deactivation cancels existing one.

      We have noticed, that when JBoss is started and the timer is on, there is a problem with loading scripting engines (It is performed in javax.script.ScriptEngineManager class). The application's check whether scripting engine named Groovy exists, fails, and therefore no scripting engine can be loaded. If the same action is initialized not by timed method, but, let's say, by some GUI event, manually, everything is going fine, and scripting engine is being loaded perfectly. Otherwise, if the timer is turned off before JBoss shut down, then, after restarting the application and manual start of the timer, everything goes fine as well. And, if after scripting engine loading failure, we just restart the timer, everything is OK!

      We suppose, that there is some problem with ClassLoader if the timer is alive when JBoss is starting, and some external classes are not loaded. Did anybody encountered such a problem? Is there any way to force cancellation of all timers and creation of new instances during JBoss initialization?

      Thanks in advance!