6 Replies Latest reply on Mar 19, 2002 5:47 AM by Adrian Brock

    A BUG about ClassCastException in jboss-3.0.0beta_tomcat-4.0

    Thomas Phan Newbie

      I've a session EJB's method. It returns a custom class that implements Serializable. I'm sure that my class is legal in the EJB tier before it's marshalled. The ClassCastException is throwed in the Tomcat stub.

      Note:
      -the error happens only on the side from EJB to web, i.e. passing my custom class as a parameter to a EJB method is OK
      -EJB methods can return a standard Java object (e.g. String, Object) with no problem (does this relates to the web stub's classpath?)
      -I tried to cast my custom class to java.lang.Object, and get it from the web tier; it doesn't complain as long as I don't cast the Object back in the web tier
      -I don't get this problem when I'm using JBoss 3 beta with an external Tomcat 4.0.1

      The error msg:
      java.lang.ClassCastException: esb.interfaces.UserData
      at $Proxy30.getUser(Unknown Source)
      at esb.web.UserAction.perform(Unknown Source)
      at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1787)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

      If someone changed the code, how may I get the update from the CVS (I thought that the current CVS supports Jetty only, by default)?