0 Replies Latest reply on Jul 23, 2008 10:32 AM by Vinicius Carvalho

    ClassCastException on remote Mbean invocation

    Vinicius Carvalho Apprentice

      Hello there! Our app is running inside JBoss portal and we have scoped deployment (we use a more up-to-date version of hibernate) So we set our loader-repository on the jboss-app.xml

      Well, in a certain moment we need to use the portal sessionfactory and we gain access to it through:

      MBeanServer server = MBeanServerLocator.locateJBoss();
      ObjectName name = new ObjectName("portal:service=Hibernate");
      Object o = server.invoke(name, "getSessionFactory", new Object[]{}, new String[]{});

      When casting "o" we are getting a classcastexception.

      We have CallByValue set to true. So I can't figure out what else should we do.

      Any ideas?

      Best regards