1 Reply Latest reply on Jul 18, 2005 2:52 PM by shiraz memon

    Problem sending objects using EJB3

    Robert Slaght Newbie

      I keep getting an error when I try to pass an object as an argument of a method to my stateless bean. The object passed implements java.io.Serializable. Both the EJB3 jar and the war contain the class file for the CreditCard object. Please help me or point me to a resource where I can look at shom examples of passing object through function calls using EJB3.

      Here is the example code

      //client side
      public boolean validateCreditCardPurchase(CreditCard cc,
      String amount, String merchantID) throws Exception {

      InitialContext ctx = new InitialContext();
      GeckoModelLocal gecko = (GeckoModelLocal) ctx.lookup
      (GeckoModelLocal.class.getName());
      return gecko.validateCreditCardPurchase(cc,amount,merchantID);

      }

      //EJB3 stateless session side
      public boolean validateCreditCardPurchase(CreditCard cc, String amout,
      String merchantID) throws Exception {

      String cardHolderName = cc.getName();
      return true;

      }


      //The error is
      javax.ejb.EJBException: null; CausedByException is:
      argument type mismatch
      org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:46)
      org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:70)
      org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:72)
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:93)
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:148)
      org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:65)
      $Proxy90.validateCreditCardPurchase(Unknown Source)
      model.GeckoDelegate.validateCreditCardPurchase(GeckoDelegate.java:175)
      account.action.WebHostingPaymentInformationAction.execute(WebHostingPaymentInformationAction.java:171)
      org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
      org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
      org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
      org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
      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)