0

我有一个运行良好的JEE7 maven Web 应用程序,直到我在我的一个 EJB 上添加了@Schedule注释。

从那时起,NetBeans 7.4不想再使用GlassFish-Server-4.0部署我的项目。我只需要注释我的注释行就可以再次部署。

这是我班级的代码:

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");
    }
}

这是我得到的例外:

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

编辑:我尝试在 glassfish 管理控制台中 ping EJB 计时器服务。它以失败告终。这是我的障碍,但我不明白为什么或如何解决它。

4

1 回答 1

0

EJB 计时器服务不在 Java EE 7 Web 配置文件中,因此请确保在 Project -> Properties 中应用程序类型是 javaee-7,而不是 javaee-7-web。

于 2014-01-25T05:54:03.397 回答