7 Replies Latest reply on Jun 21, 2004 5:52 PM by gudmundsonsc

    ClassCastException After HotDeploy Stateful Session Bean

    gudmundsonsc Newbie

      Firstly, I am using the all configuration (haven't tried this yet in any other configurations). And I am accessing a Stateful Session Bean from a web app. It works good before hot deploy of the ejb, but throws ClassCastException after hot deploy of the ejb.

      This code is the code to access the ejb from the web app:

      Context ctx = new InitialContext();
      Object ref = ctx.lookup("ejb/business/teacherapplication/TeacherApplicationSession");
      teacherApplicationSessionHome = (TeacherApplicationSessionHome) ref; // <-- this is the line throwing the ClassCastException


      I added this code to try to figure out what is going on inside jboss:

      log.debug("CLASS LOADER="+TeacherApplicationSessionHome.class.getClassLoader());
      log.debug("CLASS LOADER="+ref.getClass().getClassLoader());


      This is what I get before hot deploying:

      CLASS LOADER=org.jboss.mx.loading.UnifiedClassLoader3@9fac35{ url=file:/D:/Jboss/jboss-3.2.4/server/default/tmp/deploy/tmp10294teacherapplication-deployment.ear ,addedOrder=58}
      CLASS LOADER=org.jboss.mx.loading.UnifiedClassLoader3@9fac35{ url=file:/D:/Jboss/jboss-3.2.4/server/default/tmp/deploy/tmp10294teacherapplication-deployment.ear ,addedOrder=58}


      I noticed the class loaders are exactly the same.

      Now, this is what I get after hot deploying the ejb:

      CLASS LOADER=org.jboss.mx.loading.UnifiedClassLoader3@9fac35{ url=null ,addedOrder=58}
      CLASS LOADER=org.jboss.mx.loading.UnifiedClassLoader3@27aaf0{ url=file:/D:/Jboss/jboss-3.2.4/server/default/tmp/deploy/tmp10295teacherapplication-deployment.ear ,addedOrder=59}


      For some reason they are different now. I'm not sure what this means myself, but I think it would expose a problem to a jboss expert.

      I have tried packaging the web app seperatly or in the same ear as the ejb, both with the same results.

      Any ideas? Anything I can try? Thanks for you help.