Can anyone have the success story of connect to EJB over rmi/iiop transport?

Can I get the connection to EJB over "pure" corba iiop transport? (generating 
client stubs from IDL, initialize ORB, etc.) I try but get CORBA BAD_PARAM 
errors :((

If I use the rmi/iiop transport (solution from 
http://www.jboss.org/developers/projects/jboss/IIOP)
I get the ClassCastException :((
My client code in this case:

public static void main(String[] args) {
 lbsGW = getEjb();
}

private static LbsGWu getEjb() throws NamingException, CreateException, 
RemoteException {
        javax.naming.Context context = getContext();
        System.out.println("after getContext");
        java.lang.Object obj = context.lookup("LbsGWUniformHomeRemote");
       if(obj != null) {
          try {
                  return ((LbsGWuHome) 
javax.rmi.PortableRemoteObject.narrow(obj,LbsGWuHome.class)).create();
          }catch (Exception e) {
           e.printStackTrace();
           return null;
          }
        }
          return null;
    }


private static javax.naming.Context getContext() throws NamingException {

        Properties p = new Properties();
        p.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, 
"com.sun.jndi.cosnaming.CNCtxFactory");
        p.put(javax.naming.Context.PROVIDER_URL, 
"corbaloc:iiop:localhost:3528/JBoss/Naming/root");
        System.out.println("create InitialContext");

      try {
        javax.naming.Context ctx= new InitialContext(p);
        
        return ctx;
       }catch (Exception e) {
        e.printStackTrace();
        return null;
       }
    }

LbsGWuHome and LbsGWu - home and remote EJB interfaces, generates from XDoclet.

exception rises in return ((LbsGWuHome) 
javax.rmi.PortableRemoteObject.narrow(obj,LbsGWuHome.class)).create();
step





View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3856382#3856382

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3856382


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to