7 Replies Latest reply on Nov 3, 2010 6:54 AM by Gabor Auth

    EJB call from 4.2.3 to 5.1.0?

    Gabor Auth Newbie



        I have got a JBoss 4.2.3.GA cluster and a JBoss 5.1.0.GA cluster and I migrating services from 4.2.3 to 5.1.0... but I can't call remote EJB3 from JBoss 4.2.3 to JBoss 5.1.0, it is possible?


        What did I do:

            String className = "name of the Remote interface";

            String providerUrl = BIND_ADDRESS + ":1100";

            Properties properties = new Properties();

            properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");

            properties.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");

            properties.put(Context.PROVIDER_URL, providerUrl);

            InitialContext ic = new InitialContext(properties);

            ServiceRemoteInterface service = (ServiceRemoteInterface) ic.lookup(className);


        The last line throws an exception:

      java.lang.ClassCastException: javax.naming.Reference cannot be cast to hu.package.ServiceRemoteInterface


        What did I do wrong? What can I do? Any idea?


      Gábor Auth