0

I have a JEE7 maven web application that worked fine until I put a @Schedule annotation on one of my EJB.

Since then, NetBeans 7.4 don't want to deploy my project any more using a GlassFish-Server-4.0. I just have to comment the line of my annotation to be able to deploy again.

Here is the code of my class:

package org.m2acsi.boundary;

import javax.ejb.Schedule;
import javax.ejb.Stateless;

@Stateless
public class Automaton {

    @Schedule(second = "*/10", minute = "*", hour = "*")
    public void everyDay() {
        System.out.println("Test");
    }
}

Here is the exception I get:

Grave:   Exception while loading the app
Grave:   Undeployment failed for context /FullStore
Avertissement:   EJB Timer Service is not available. Timers for application with id 91131533448380416 will not be deleted
Infos:   file:/C:/Sites/FullStore/target/FullStore-1.0-SNAPSHOT/WEB-INF/classes/_storePU logout successful
Grave:   Exception while loading the app : EJB Timer Service is not available

Edit: I tried to ping the EJB timer service in the glassfish admin console. It ends with a failure. This is my blocking point but I cannot understand why or how to fix it.

Florent Henry
  • 702
  • 1
  • 7
  • 25
  • Try stopping GlassFish and looking for .lck files in glassfish4/glassfish/domains/domain1/lib/databases/ejbtimer. Delete them and restart. – Ian Evans Feb 28 '14 at 18:23
  • There is no such directory. My "databases" directory only contains mysql-connector-java-5.1.29-bin.jar – Florent Henry Mar 01 '14 at 19:01
  • Then I would check your full server.log file to see why the Timer Service is failing. This issue might be relevant as well. http://stackoverflow.com/questions/13292473/set-configure-the-ejb-timer-services-datasource – Ian Evans Mar 03 '14 at 21:12

1 Answers1

0

The EJB timer service isn't in the Java EE 7 web profile, so make sure the application type is javaee-7, not javaee-7-web, in Project -> Properties.

Ian Evans
  • 1,357
  • 10
  • 10