Best way to create a daemon in a JavaWeb application
Using a ServletContextListener is a good solution, I would use the same.
I would consider using a ScheduledExecutorService here (Executors.newScheduledThreadPool(1)). It has some advantages:


It has a scheduleWithFixedDelay method as well as scheduleAtFixedRate. Using one of these describes what's the developer's purpose. Currently its not completely obvious or explicit.
It supports shutdown and awaitTermination. awaitTermination returns immediately when your task finishes, no need to wait complete seconds.
awaitTermination returns false on timeout when you can call shutdownNow which interrupts the thread of the task.
It does not need manual and error-prone synchronization (see the next point).
newScheduledThreadPool can get a ThreadFactory. You can set a UncaughtExceptionHandler to handle uncatched exceptions with that factory. (See also this answer too.)

Usage of isDaemonWorking is not thread-safe. It is used by the timer's thread (inside the TimerTask.run method) as well as the ServletContextListener. Without any synchronization you risk that threads will not see each other's modification.


  [...] synchronization has no effect unless both read and write operations are synchronized.


From Effective Java, 2nd Edition, Item 66: Synchronize access to shared mutable data.
You could invert the if condition here:


for (; i&lt;10; i++) {
    if (isDaemonWorking) {
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch(InterruptedException ex) {
            Thread.currentThread().interrupt();
        }
    } else {
        break;
    }
}



It would keep the code flatten:

for (; i &lt; 10; i++) {
    if (!isDaemonWorking) {
        break;
    }
    try {
        TimeUnit.SECONDS.sleep(1);
    } catch (InterruptedException ex) {
        Thread.currentThread().interrupt();
    }
}

I guess if you put the isDaemonWorking = false into a finally block:

try {
    isDaemonWorking = true;
    System.out.println("I RUN");
} catch (Throwable e) {
    e.printStackTrace();
} finally {
    isDaemonWorking = false;
}


then you could replace


if (i == 10)
    timerTask.cancel();



with

if (isDaemonWorking) {
    timerTask.cancel();
}


and use an usual for (int i = 0; i &lt; 10; i++) loop too.
I would not think that initialization of TimerTask should be in a static block. The timer and isDaemonWorking also could be instance fields. I think (and I would expect that) the servlet container calls contextDestroyed on the same instance than contextInitialized.
Variable names in Java usually camelCase, so a_event should be aEvent or just event here:


public void contextInitialized(ServletContextEvent a_event) {


I guess you have a typo here: BiuDeamon (it should be BuiDaemon).