I have application logic for writing a log file to an @RequestScoped bean. I would like to write a protocol just before the @SessionScoped bean expires.
@SessionScoped class Anybean implements Serializable { @Inject private ProtocolBean protocolBean; @PreDestroy private void writeFinalProtocol() { protocolBean.writeProtocol(); }
}
I get the error message: WELD-000019 Instance destruction error Managed bean. Is it generally forbidden to call other beans from @PreDestroy?
source share