1 Reply Latest reply on Oct 28, 2004 8:21 PM by sal ingrilli

    home.create () ClassCastException

    sal ingrilli Newbie

      When my jboss 3.2.4RC1 / jvm 1.3.1_02 app is installed on multiprocessor windows machines (2000/xp), I get some really weird behavior.

      First of all, my app will run for hours and sometime days.
      Then I start getting ClassCastException's thrown by home.create () for stateless session beans.

      This is the code in question. Basically, I am using a cached SiteManagerHome to create a SiteManager stateless session bean remote interface:

      public static SiteManager getSiteManager () throws Exception {
       final HomeFactory homeFactory = (HomeFactory) SingletonManager.getInstance (HomeFactory.class);
       final SiteManagerHome home = (SiteManagerHome) homeFactory.getHome (SiteManager.class);
       return home.create ();
      }
      


      home.create () throws this exception:
      java.lang.ClassCastException: java.lang.String
       at $Proxy72.create(Unknown Source)
       at com.syncvoice.vxtracker.util.EjbManager.getSiteManager(EjbManager.java:224)
      


      It looks as if instead of returning a SiteManager object, home.create () is returning a java.lang.String!

      FYI, when this happens, our system is performing a lot of home.create ()'s as it's performing some backend processing. Note, however, that I do cache the home interfaces (that's what the HomeFactory above does).

      I have also seen the same behavior for cmp's, where a cmp home.findByPrimaryKey () should return a cmp local interface, but ends up returning a java.lang.String instead. As in the above case, the system works fine for hours/days, and then it just starts to happen.

      Any help/clues greatly appreciated!

        • 1. Re: home.create () ClassCastException
          sal ingrilli Newbie

          fyi, i upgraded the jvm from 1.3.1_2 to 1.4.2_06 and the problem went away... at least until now!

          the system has been up for 8 days up to now, and it has been processing more data than before, roughly equivalent to an additional 10%-20% ejb/cmp calls.

          there is nothing a java programmer can do to hang a jvm... at least theoretically, but 1.3 surely has some issues. i guess that's why whenever i lookup an issue on the sun site, their first solution is to upgrade to 1.4!

          anyway... hope this helps others.