I need "TestSessionHome" but get "CDRInputStream$1"

Hi all! what about this:
I deployed a session bean TestSession in Sun's app server.
I made a client to test the bean, it runs outside of the app server
here the code:
package myjca.client;
import javax.naming.*;
import java.util.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import com.testing.session.*;
* @author zurdo1119
public class TestClient
     //Prints the context
     private static void printContext(Context contexto, String contextoS, int a) throws NamingException
          int b;
          NameClassPair c;
          NamingEnumeration enum2;
          if (a == 0)
               enum2 = contexto.list(contexto.getNameInNamespace());
          else
               enum2 = contexto.list(contextoS);
          while (enum2.hasMore())
               b = a;
               while (b-- > 0)
                    System.out.print("--");
               c = (NameClassPair)enum2.next();
               System.out.println(c);
               if (c.getClassName().equals("javax.naming.Context"))
                    printContext(contexto, c.getName(), a + 1);
     //Connect to TestSession
     public static void testConn()
          InitialContext initCtx = null;
          Object obj = null;
          try
               initCtx = getInitialContext();
               printContext(initCtx, "", 0);
               TestSessionHome helloWorldHome =
                    (TestSessionHome)PortableRemoteObject.narrow(
                         initCtx.lookup("TestSession"),
                         TestSessionHome.class);
               TestSession helloWorld = helloWorldHome.create();
               helloWorld = helloWorldHome.create();
               String pepe = helloWorld.helloWorld();
               System.out.println("Pepe es: " + pepe);
          catch (Throwable ex)
               ex.printStackTrace();
     //Get context
     private static InitialContext getInitialContext() throws NamingException
          Hashtable env = new Hashtable();
          env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
          env.put(Context.PROVIDER_URL, "iiop://localhost:1050");
          return new InitialContext(env);
     public static void main(String[] args)
          testConn();
}Runing the client I get the context(the method "printContext" does it) and then a exception:
ServerObject: com.sun.corba.se.internal.iiop.CDRInputStream$1:com.sun.corba.se.internal.iiop.CDRInputStream$1:IOR:000000...
RemoteLogReader: com.sun.corba.se.internal.iiop.CDRInputStream$1:com.sun.corba.se.internal.iiop.CDRInputStream$1:IOR:000000...
TestSession:com.sun.corba.se.internal.iiop.CDRInputStream$1:com.sun.corba.se.internal.iiop.CDRInputStream$1:IOR:000000001...
java.lang.ClassCastException
     at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Unknown Source)
     at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
     at myjca.client.TestClient.testConn(TestClient.java:45)
     at myjca.client.TestClient.main(TestClient.java:70).
This exception was caused by the narrow.
You can see that "TestSession" is there but as "CDRInputStream$1" and I need "TestSessionHome".
Whats wrong?
Thanks
Zurdo

Hi zurdo,
I have the same problem!!!!!!!!!!
If you have solved it, could you give me any help?
Thanks,
Fil

Similar Messages

Maybe you are looking for

  • Pre Database Insert / Update Validation

    Hi, I have a maintenance view that allow user to insert / update. Let's say, z_my_table is my table key1 key2 field1 field2 field3 I want to validate whether field1, field2, field3 whether exist in my table before insert / update. However, due to som

  • Accessing Home Hub 4 with windows 8.1 and Internet...

    Hello I can no longer access my home hub manager wirelessly running windows 8.1 and Internet Explorer 11 from my toshiba laptop by either typing in the IP address or by http://bthomehub.home/. I can still access it by either method from a laptop runn

  • TS3989 Videos in photo stream

    Videos shot on my iphone are not showing up on my photostream on my ipad

  • Firefox sometimes does not end

    14.7.2014 Firefox 30.0 (German version) under Win 8.1 Hello, Sometimes Firefox does not end properly. When Firefox is re-started I get a message saying Firefox is still running although about 10 minutes has passed between end and the re-start. Only b

  • Business Event Subscription Changes don't take immediate effect

    Hi, it seems that whenever I make changes to my business event subscriptions the changes only take effect the next day. (Almost like there is some concurrent request running at night, or something bounced to make the changes) Does anybody know what n