1 2 Previous Next 20 Replies Latest reply on Jan 22, 2003 7:14 PM by adrian.brock Go to original post
      • 15. Re: Classcastexception(again) driving me crazy
        anderssv

        How do you redeploy the war? Is it outside the ear? Touching web.xml when the war is inside the ear does not redeploy it. It seems strange, that it's like this. It should handle it when redeploying the whole app.

        Anders,

        • 16. Re: Classcastexception(again) driving me crazy

          These are two different problems.

          For an ear this should be fixed in 3.0.5
          The problem is due to a VM "bug" caching classes
          against the wrong classloader.

          url=file:/C:/java/jboss-3.0.4/server/default/tmp/deploy/server/default/lib/jnpserver.jar/36.jnpserver.jar

          Incidentally, if you have a jndi.properties in your
          deployment or you are using new InitialContext(Hashtable)
          change it to use
          new InitialContext().
          That could fix it on 3.0.4, it is certainly more
          efficient.

          The second problem is separate wars and ejbs.
          If you redeploy an ejb after a servlet has loaded the
          class, the servlet will not automagically reload the
          class. You have to redeploy the servlet/war.

          Regards,
          Adrian

          • 17. Re: Classcastexception(again) driving me crazy
            anderssv

            The new InitialContext() without a hastable was the thing that fixed it. Thanks guys! :)

            The error still occurs on 3.0.5 though when using new InitialContext(Hashtable). Maybe something to look into.

            But my stuff works! Thanks! :)

            Anders,

            • 18. Re: Classcastexception(again) driving me crazy
              garvett

              I attempted to upgrade to 3.0.5 (w/Tomcat 4.0.6) from 3.0.2, and the problem remains for me as well. I have an .ear file containing both a .war and .jar, and hot deploying (touched off by updating either the .war or the .jar) fails with the ClassCastException. I was previously using 2.4.0, and never encountered these difficulties.

              • 19. Re: Classcastexception(again) driving me crazy
                mschwaller

                I have had similar problems using the JBoss 3.0.4/Tomcat bundle. If I re-deploy my ejb jar file, my web application gives me a ClassCastException. I need to redeploy my web application for it to work.

                M

                • 20. Re: Classcastexception(again) driving me crazy

                  That is correct.

                  If your servlet/jsp is holding an ejb class,
                  redeploying the ejb will fail.
                  One solution is to seperate the ejb interfaces into
                  another jar "the contract" which doesn't get redeployed
                  when you just change the bean implementation.

                  Change the contract, you redeploy everything.

                  The other solution is use an ear and redeploy
                  everything everytime.

                  Regards,
                  Adrian

                  1 2 Previous Next