This is my implementation:
@ManagedBean
@SessionScoped
public class MySesssionBean {
@PreDestroy
public void destroy() {
Ivy.log().fatal("Hi there");
}
}
But we still got the error:
Caused by: ch.ivyteam.ivy.environment.EnvironmentNotAvailableException: Access to ivy environment outside a process request thread is not possible.
Current thread: Thread[ContainerBackgroundProcessor[StandardEngine[ivy]],6,main]
at ch.ivyteam.ivy.environment.Ivy.getIvy(Ivy.java:577)
at ch.ivyteam.ivy.environment.Ivy.getEnvironmentData(Ivy.java:556)
at ch.ivyteam.ivy.environment.Ivy.getEnvironmentData(Ivy.java:551)
at ch.ivyteam.ivy.environment.Ivy.log(Ivy.java:413)
We can't get any ivy environment here :(