0 Replies Latest reply on Dec 14, 2006 4:53 PM by Tonio Caputo

    java.lang.ClassCastException in EJB-Proxy

    Tonio Caputo Newbie

      Hi,

      I'm usign 4.0.5/EJB3 and an independent Tomcat 5.5
      Ububntu 5-10 java 1.5.08.

      Using StatelessSessionBean with a BusinessDelegate as a facade.

      The application is a web-service front end to EJB methods, it is
      working ok, but:
      Every now an then, sometimes after re-deploying, sometimes after
      restarting jboss, a call to Business-Method (isUserAuthorized) from
      my tomcat application (web-service) gives this error

      Caused by: java.lang.ClassCastException: isoa.users.bean.UserContext
       at $Proxy15.isUserAuthorized(Unknown Source)
       at isoa.users.bean.UsersServiceBd$3.run(UsersServiceBd.java:91)
       at isoa.commons.bean.AbstractBizDelegate$EjbRun.runWithRetries(AbstractBizDelegate.java:150)
      
       ... 37 more


      package isoa.users.bean;
      
      // Value-Object for returning multiple values
      public class UserContext implements java.io.Serializable
      {
       public int contractId = -1;
       public int userId = -1;
       public int beingId = -1;
       public int methodId = -1;
       public int serviceId = -1;
       public int implementationId = -1;
       public int hits = -1;
       public Integer pendingHits;
      
      }
      
       // Bean Method
       // It does not return null.
       public UserContext isUserAuthorized(
       String ticket
       ,InetAddress ipAddr
       ,int serviceId
       ,int implementationId
       ,int methodId
       ) throws IsoaException;
      



      UserContext class is in the class-path, I checked the version is
      always the same in my client and in my server, etc., etc..., all
      seems pretty ok.

      WebApplication include jars with all the interfaces and implementation
      of EJB3 session.

      Sometimes after calling the method a second time or just re-deploying begins to work OK again.

      Any Idea where to look for, or what is happening

      Thanks in advance
      tonio