3 Replies Latest reply on Jun 11, 2003 7:01 AM by Jon Martin Solaas

    classCastException

    Bijoy Sivan K Newbie

      Hi All,

      When I try to access an entitybean from a session bean I get java.lang.classCastException.

      Could you please tell me how to rectify it ?

      Thanks in advance

      Bijoy

        • 1. Re: classCastException
          dash Newbie

          Hmm we need more details... like the source code and the line where the error happens...

          • 2. Re: classCastException
            Bijoy Sivan K Newbie

            I am using entity beans and the enitity beans is accessed using a session bean. The insertion and updation works perfectly fine when I run the applicaiton immediately after JBOSS is started. THe application works perfectly alright.

            The problem is, when I do a hot redeployment after making some changes in the bean and try to do insert by calling create method, then ClassCastException comes. The application works fine after restarting the JBOSS server. Though my applicaiton works fine after restarting the server, my worry is that , while running whether this exception will be thrown or not.

            How can I solve this problem

            Bijoy

            • 3. Re: classCastException
              Jon Martin Solaas Newbie

              So, where is your source code? Hard to tell what's wrong when you don't post it.

              I had the same problem, occured after upgrade from 3.0.6 to 3.0.7.

              I was using some parameters to the InitialContext constructor that turned out not to work so well from 3.0.7 and upwards, when both client and ejb container were running in the same JVM.

              Try to use the InitialContext() constructor that takes no params.