Discussions

EJB programming & troubleshooting: why classcastException comes in our case

  1. why classcastException comes in our case (4 messages)

    hello freinds,

    we are getting these problems , if possible help us.

    1) i am using a javabean to invoke a session bean which invokes the entitybean. this javabean is used in jsp page. i put the javabean in c:\weblogic\myserver\servletclasses folder.

    i had taken a jsp page in which a instantiate the javabean, lets say first.jsp and then
    i do the clientside validations and submiting to the server and inserts a record in db and i am redirecting to the first.jsp . then it gives the
    classcastexception and nested with class cannot be instantiated(the javabean class). why this is happening , if these are errors when the page is downloaded for the first time it is not giving these errors , only when i redirect to this page or comes back and click refresh this error comes.

    2) how to invoke a ejbremove method in (cmp) when i want to remove a record from database.
  2. ClassCastExceptions happen when the same class is loaded by 2 different classloaders, so make sure class which gives you this exception can be loaded by only one classloader.
  3. hello freind,

    can you please give me more details in breif.
  4. Maybe you should read the following:

    http://www.weblogic.com/docs51/classdocs/API_servlet.html#classcastexception

    You exactly did, what is described in this document: you placed your JavaBean in the servlet classpath and that causes the problems with the different class loaders.

  5. hi Friend,

    If you got More Details About EJB please send me