0 Replies Latest reply on Nov 24, 2011 8:32 PM by netsrac

    Using Resteasy Asynchronous Job Services in Seam 3

    netsrac

      Hi everybody,


      I'm trying to use Resteay Async Jobs in my Seam 3 Application. I call my Stateless Webservice from an external client with adding the


      ?asynch=true



      parameter to the url and start doing some work. Generally it works quite fine ... BUT
      Only autheticated users shall be able to use my Webservice. I tried to solve this by sending
      username and password as a parameter and starting the login:


      credentials.setCredential(new PasswordCredential(password));
      credentials.setUsername(username);
      identity.login();


      But acessing the @Inject credentials or identity object causes failures. (Other Injected variabled can be acessed). It just works when I acces my webservice synchron without the mentioned asynch parameter. Otherwise I get the following Exception:



      javax.ejb.EJBTransactionRolledbackException: WELD-001303 No active contexts for scope type javax.enterprise.context.SessionScoped



      My asynchronous Web Service is configured as described in the Resteasy Guide (web.xml):
      My Link


      Does anybody know why this is not working, if it is possible to get it working with seam 3?
      Or does anybody have any other idea how to implement such a job processing with authentication?
      I'm thankful for every reply!




      How does the job processing work?
      I call the webservice, and get a URL returned as far as the call has reached the server. Now I can query this URL to get the Status of the processing (Statuscode 202 is still processing, 200 is finished) SO I can do any work, while the service is running.