0 Replies Latest reply on Oct 8, 2005 11:47 AM by guilherme_82

    Which methods and Annotations are required for Stateless Ses

    guilherme_82

      Hi everybody,

      I am sick and tired of this Stateless Session Bean! Are there any methods that must be explicitly declared in it, like ejbCreate, ejbRemove, ejbPassivate and ejbActivate with their respective Anntotations?
      And what about the business methods?

      My Stateless Session Bean and its interfaces are:

      public interface Logar {

      public BancarioVo mymethod (String login, String senha) throws SQLException, Exception;

      }

      @Remote
      public interface LogarFacadeRemote extends Logar{

      }

      @Stateless
      public class LogarFacadeSessionBean implements LogarFacadeRemote{

      public LogarFacadeSessionBean(){
      }

      public BancarioVo mymethod (String login, String senha) throws SQLException, Exception{
      ...
      }
      }

      My client is a DispatchAction of Struts:

      public class LogarAction extends DispatchAction{

      public ActionForward method (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws SQLException, Exception{

      InitialContext context = new InitialContext();
      String lookup = LogarFacadeRemote.class.getName();
      LogarFacadeRemote logar = (LogarFacadeRemote) context.lookup(lookup);
      BancarioVo bancarioVo = logar.mymethod(login, senha);
      }
      }

      when I execute the line:
      BancarioVo bancarioVo = logar.mymethod(login, senha);

      I get the exception:

      java.lang.NoSuchMethodError: org.jboss.aop.joinpoint.MethodInvocation.([Lorg/jboss/aop/advice/Interceptor;JLjava/lang/reflect/Method;Ljava/lang/reflect/Method;Lorg/jboss/aop/Advisor;)V
      org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:77)
      $Proxy94.autenticarBancario(Unknown Source)
      sistemaBancario.cliente.struts.logar.LogarAction.autenticarUsuario(LogarAction.java:70)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:585)
      org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
      org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
      org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
      org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
      org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
      org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)

      The problem is with my businessMethod. I think my session bean initializes perfectly. Does this error have something to do with initializing methods, like ejbCreate, ejbRemove...?
      Do they have to be declared in the remote interfaces? What about the @BusinessMethod Annotation? Is it really necessary? Where? when?
      Does this have to do with this message of jboss when the application is deployed?

      12:15:52,746 INFO [ProxyDeployer] no declared remote bindings for : sistemaBancario.servidor.facade.logar.LogarFacadeSessionBean

      Can anybody give me a hint? I am desperate!!!

      Thanks, Guilherme