Topic
  • 1 reply
  • Latest Post - ‏2011-04-04T19:08:41Z by bergmark
denisF
denisF
12 Posts

Pinned topic CDI : EJB 3.1 stateful session bean with no interfaces supported?

‏2011-04-03T17:20:59Z |
With this SFSB (with no interface as allowed by EJB 3.1 spec) :

... @Stateful @SessionScoped 

public 

class CurrentUserManager 
{ 

private User currentUser;   @Produces @Authenticated @Named(
"currentUser") 

public User getCurrentAccount() 
{ 

return currentUser; 
} ... 
}


I receive this exception at startup:


[4/3/11 13:12:50:329 EDT] 0000000f WebContainerL I WebContainerLifecycle startApplication OpenWebBeans Container is starting... [4/3/11 13:12:50:705 EDT] 0000000f BeansDeployer E BeansDeployer deploy org.apache.webbeans.exception.WebBeansConfigurationException: Producer Method Bean must be business method of session bean : WSEjbBean [businessLocals=[], ejbName=

null -798102467,Name:null,WebBeans Type:ENTERPRISE,API Types:[org.jboss.seam.examples.booking.account.CurrentUserManager,java.lang.Object],Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default] at org.apache.webbeans.ejb.common.util.EjbUtility.checkProducerMethods(EjbUtility.java:183) at org.apache.webbeans.ejb.common.util.EjbUtility.fireEvents(EjbUtility.java:93) at org.apache.webbeans.ejb.WSEjbPlugin.defineSessionBean(WSEjbPlugin.java:375)
Updated on 2011-04-04T19:08:41Z at 2011-04-04T19:08:41Z by bergmark
  • bergmark
    bergmark
    8 Posts

    Re: CDI : EJB 3.1 stateful session bean with no interfaces supported?

    ‏2011-04-04T19:08:41Z  
    I've opened an internal defect to track this issue, as it appears to be a bug to me.

    It looks like no methods are being detected as business methods because there there is no declared business local interface.

    You should be able to work around this in the short term by creating an @Local interface and implementing that in this bean.