0 Replies Latest reply on Oct 8, 2005 4:21 PM by Guilherme Melo e Maranhão

    Problem acessing business mehod of Session Bean

    Guilherme Melo e Maranhão Newbie

      Hi,

      I am trying to access a business method of a stateless session bean, but receive 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
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:77)
      at $Proxy80.autenticarBancario(Unknown Source)
      at sistemaBancario.cliente.struts.logar.LogarAction.autenticarUsuario(LogarAction.java:70)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
      at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:157)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)

      This my Session Bean and its business interface:

      @Stateless
      public class LogarFacadeSessionBean implements LogarFacadeRemote{

      public LogarFacadeSessionBean(){
      }

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

      @Remote
      public interface LogarFacadeRemote{

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

      }

      This is my client:

      public class LogarAction extends DispatchAction{

      public ActionForward autenticarUsuario (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);
      ...
      }

      }

      It passes normally til the line

      LogarFacadeRemote logar = (LogarFacadeRemote) context.lookup(lookup);

      but when I invoke the method

      BancarioVo bancarioVo = logar.mymethod (login, senha);

      it throws the exception above.

      Anybody knows what is causing this error??
      What else should I have in my Session Bean?
      Is missing any Annotation (@BusinessMethod, @Interceptor...)?
      What about the callback methods?
      Are they necessary?
      Where should I declare them?

      I am doing exactly the way tutorials recommends!

      Thanks, Guilherme