0 Replies Latest reply on Apr 15, 2005 10:56 AM by anders.hedstrom

    ClassLoader question

    anders.hedstrom

      Hi all,

      I have a SLSB that tries to send an Object to a remote location, in case of there is a problem during the transfer the SLSB saves the Object to a database and starts a Timer Bean that will read the Object from the database and try to send it again.

      But I have some problems, I get ClassCastExceptions all the time when the Timer Bean tries to cast it to its type when it has read it from the database.

      This has probably something to do with ClassLoader - If I print out the ClassLoader to the screen after it has bean loaded from the database it is null

      Object obj = rs.getObject(1);
      log4j.info(obj.getClass().getClassLoader()); // generates null
      MyType mt = (MyType)obj; // generates ClassCastException


      How can I fix this?

      Greatfull for any suggestions!

      Cheers

      //Anders =)