java - Can I access a SessionScoped CDI bean from a created Thread? -
I have a web application that has a session-signed
bean that works a bit like my JSF On the page, I have a button that I want to enable the client to proceed with the progress of the updated work on the page by AJAX
.
To solve my idea, it was meant to create a new class that implemented Runnabl, which calls the business method of my session. Scoped Bean I submit the submit button on the JSF page to a request squid Suppressed in a bean that creates a new thread and starts my runnabl.
The problem with this approach is that the Member variable of session SOCODED bean needs to be updated by the new thread Here is what I have tried here.
@ Named @ session Public Work Worker (Public Functioning); } @Nominated @Required Public Class Submitter {@ Remove Private Staff Worker; Public Start () () () (New Thread (Runner (This Worker)) Launch ();}} Executives Public Class Runner Runnable {Private Worker worker = null; Public runner (worker w) {this.worker = W}} Public Start () {this.worker.workMethod ();}}
When I workMethod: org.jboss.weld.context.ContextNotActiveException: WELD-001303 If someone tries to call it happens in a WELD error, there is no active reference for scope type javax .enterprise.context.SessionScoped
I Java E E6
. I am just trying to get my way through this and I am not making trouble for myself.
Comments
Post a Comment