0 Replies Latest reply on Feb 19, 2010 2:10 PM by Ole Hornischer

    Misterious ClassCastExceptions during EJB use

    Ole Hornischer Newbie

      Hey everyone!
      I have a weird problem. I get ClassCastExceptions of the following kind while using EJB stateless session beans from my seam project:

      Caused by javax.el.ELException with message: "java.lang.ClassCastException: com.tza.dto.RegisteredClientDTO cannot be cast to com.tza.dto.RegisteredClientDTO"

      The history: I have an application, that used to be deployed as an ear file in my app server and served to a set of java clients. All worked fine. Now I wanted to add a web component to the application providing visualisation for some data retrieved from the sever ear. So at first I created a seam war file accessing stateless session beans on the server ear to retrieve the data. But that wouldn't work. I got said ClassCastExceptions.
      I then packaged the old application and the new web app into one big ear file. The data was still accessed via SSBs and I have the same problem.

      Somewhere I read that this can be caused by duplicate class files in the classpath, so i cleaned up the cp and now do not have any doubles left - same problem.

      The example exception I get after trying to access objects from a List<RegisteredClientDTO> I retrieved via an EJB from the server app to my web app.

      Any ideas what could cause this behaviour?