0 Replies Latest reply on Mar 3, 2004 12:48 PM by djeq

    Corba ClassCastException

    djeq Newbie

      this is my jboss.xml


      <ejb-name>Hello</ejb-name>
      <jndi-name>HelloBean</jndi-name>
      <local-jndi-name>HelloLocal</local-jndi-name>
      <configuration-name>Standard Stateless SessionBean</configuration-name>
      <invoker-bindings>
      <invoker-proxy-binding-name>stateless-rmi-invoker</invoker-proxy-binding-name>


      <invoker-proxy-binding-name>iiop</invoker-proxy-binding-name>

      </invoker-bindings>


      this is my cosnaming.jndi.properties

      ava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
      java.naming.provider.url=IOR:000000000000002B49444C3A6F6D672E6F72672F436F734E616D696E672F4E616D696E67436F6E746578744578743A312E300000000000020000000000000064000102000000000A3132372E302E302E31000DC8000000114A426F73732F4E616D696E672F726F6F74000000000000020000000000000008000000004A414300000000010000001C00000000000100010000000105010001000101090000000105010001000000010000002C0000000000000001000000010000001C00000000000100010000000105010001000101090000000105010001

      this is my client code :

      java.net.URL url
      = ClassLoader.getSystemResource("cosnaming.jndi.properties");
      jndiProps = new java.util.Properties();
      jndiProps.load(url.openStream());
      InitialContext initialContext1 = new InitialContext(jndiProps);
      System.out.println(initialContext1.getEnvironment());
      home1 = (iiop.HelloHome)PortableRemoteObject.narrow(
      initialContext1.lookup(iiop.HelloHome.JNDI_NAME),
      iiop.HelloHome.class);
      iiop.Hello myBean = home1.create();

      but i get error messages. i've try 'corbaloc::localhost:3528/JBoss/Naming/root' but i got the same error.

      java.lang.ClassCastException
      at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
      at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
      at test.client1.testBean(client1.java:122)
      at test.client1.main(client1.java:177)

      am i missing something here?
      please help me.......