3 Replies Latest reply on Aug 30, 2013 3:47 AM by luksa

    Problem with @Portable and @SessionScoped annotations

    nico.ben

      Hi,

      I am developing a GWT+errai+weld application deployed in a war with jboss-as-7.1.1.final.

       

      I am facing a problem using errai's @Portable + @SessionScoped:

       

      package my.path.app.client.shared.model.transfer;

      @Portable

      @SessionScoped

      public class IdentityBean {

      ...}

       

      package my.path.app.controller.security.rest;

      @Path ("/security")

      @RequestScoped

      public class LoginService {

          @Inject private IdentityBean identityBean;

      ...}

       

      where my.path.app.client.shared.model.transfer is under the gwt shared path containing classes known both to the client and to the server

      I get this error when deploy in jboss:

       

      org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [IdentityResponse] with qualifiers [@Default] at injection point [[field] @Inject private my.path.app.controller.security.rest.LoginService.identityBean]

       

      to make the injection work I have BOTH to move IdentityBean under a package known only to the server and to remove the @Portable annotation, otherwise I get the same error.

      For example this works if I inject my.path.app.controller.security.IdentityBean2.:

       

      package my.path.app.client.shared.model.transfer;

      @Portable

      public class IdentityBean {

      ...}

      package my.path.app.controller.security;

      @SessionScoped

      public class IdentityBean2 extends IdentityBean {

      ...}

       

      Is this an already known problem?

       

      Thank you in advance,

      Nicola