I have a problem with this setup and I can't even view the logs.
This is my @Singleton
@Startup
EJB:
@Singleton
@Startup
@DependsOn("SchedulerEJB")
public class SchedulerStartUp {
private static Logger log = Logger.getLogger(SchedulerStartUp.class);
@EJB
SchedulerEJB schedEJB;
@PostConstruct
public void atStartup() {
log.info("startUp")
System.out.println("startUp");
schedEJB.cancelTimer("EBlastScheduler");
schedEJB.createTimer("*/1", "*", "*");
}
}
The SchedulerEJB
:
@Stateless
public class SchedulerEJB {
@Resource
TimerService timerService;
public cancelTimer(String timerInfo){/*...*/}
public createTimer(String sec, String min, String hour) {/*...*/}
@Timeout
public void execute(Timer timer) {/*...*/}
}
Maven pom:
//Been Using Glassfishv3.0.1 and EJB3.1 with a dependency of:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…