I'm developing a JEE Web Application (no Spring), and I'm getting this exception.
class org.jboss.weld.context.ContextNotActiveException,message=WELD-001303: No active contexts for scope type javax.enterprise.context.RequestScoped
From a JSF Backing bean I'm calling a method in an aplication scoped class, and this method executes asynchronously some
CompletableFuture.runAsync(()-> methodInTransactionGoingToRepository()}
However I'm getting that exception because it runs with no Request Context. I know I could isolate these calls in Rest APi and make some Async Posts, and it would work. But the application is small, and not suitable to have other services.
How can I solve this. Is there a way to activate a Request Scope before calling methodInTransactionGoingToRepository();
Thanks in Advance.