7 Replies Latest reply on Dec 28, 2009 3:18 PM by John Ament

    DefinitionException with Producer Method inside SLSB

    Alexander Bell Newbie

      Hi,


      I've got a AuthenticationService whith a method called getCurrentUser which should produces the current user.
      The AuthenticationService is implemented as a SLSB with a Local and Remote Business Interface. Both interfaces extend a POJI which contains all business methods.


      POJI



      public interface AuthenticationService extends Serializable {
           public User getCurrentUser();
      }




      Local Interface



      public interface AuthenticationServiceLocal extends AuthenticationService {}




      Remote Interface



      public interface AuthenticationServiceRemote extends AuthenticationService {}




      Implementation



      @Stateless
      @TransactionAttribute(TransactionAttributeType.REQUIRED)
      @Local(AuthenticationServiceLocal.class)
      @Remote(AuthenticationServiceRemote.class)
      public class AuthenticationServiceImpl implements AuthenticationService {
           @Override
           @Produces @LoggedIn
           public User getCurrentUser() {
                ...
           }




      Unfortunately on startup I get the following exception:
      org.jboss.weld.DefinitionException: WELD-000068 Method org.jboss.weld.bean-flat-ProducerMethod-org.j4fry.usermgmt.facade.AuthenticationServiceImpl.getCurrentUser() must be declared on a business interface of org.jboss.weld.bean-flat-SessionBean-AuthenticationServiceImpl
           at org.jboss.weld.bean.ProducerMethod.checkProducerMethod(ProducerMethod.java:183)
           at org.jboss.weld.bean.ProducerMethod.initialize(ProducerMethod.java:100)
           at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:111)
           at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:151)
           at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:367)
           at org.jboss.weld.integration.deployer.env.helpers.BootstrapBean.boot(BootstrapBean.java:121)



      IMO my Business Interface declares a method getCurrentUser so I don't understand that exception.


      Any ideas?


      Alex