2 Replies Latest reply on Feb 15, 2005 3:34 AM by Geir Jørgenssen

    JBoss and client on different hosts -> ClassCastException

    Geir Jørgenssen Newbie

      Hi.

      I want to move the client I made on a different host than the one JBoss is running on. Only problem is when i do this i get the following exception(first few lines of the stackTrace()):

      java.lang.ClassCastException at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(Unknown Source) at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
      at oppstart.logon.actionPerformed(logon.java:180)

      I've modified the jndi.properties file to match the server-url and all necessary jar-files are in classpath(i think) - client.jar, jnp-client.jar and jbossall-client.jar.

      Here's the part of code where I get the exception. It jumps out at the home=... line. :

      LoginHome home=null;
      Login rem=null;
      try {
      Context context = new InitialContext();
      Object ref = context.lookup("LoginBean");
      home = (LoginHome) PortableRemoteObject.narrow(ref, LoginHome.class);
      }
      catch (Exception e) {
      e.printStackTrace();
      }

      Anyone know what's wrong?