getting org.omg.CORBA.BAD_PARAM: Narrow failed, exception
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sunish_jose
Posted On:   Monday, December 4, 2006 03:37 AM

I am getting org.omg.CORBA.BAD_PARAM: Narrow failed, exception when my corba clinet try to narrow the object. I am using JacORB 2.3 and java 1.5. Thanks in advance Pease find the code below. implementaion class ====================== int i=1; public class BulkCmIRPImpl extends BulkCmIRPPOA { public void abort_session_operation(String session_id) System.out.println("Inside abort_session_operation"); } } My Server is ============ int i=1; public class BulkCmIRPServer { public static void main (String [] args) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null); t   More>>

I am getting org.omg.CORBA.BAD_PARAM: Narrow failed, exception when my corba clinet try to narrow the object. I am using JacORB 2.3 and java 1.5. Thanks in advance

Pease find the code below.
implementaion class
======================

			
int i=1;

public class BulkCmIRPImpl extends BulkCmIRPPOA {

public void abort_session_operation(String session_id)
System.out.println("Inside abort_session_operation");

}
}


My Server is
============
			
int i=1;
public class BulkCmIRPServer {

public static void main (String [] args) {
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);

try {
org.omg.PortableServer.POA rootPOA = org.omg.PortableServer.POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
POAManager manager = rootPOA.the_POAManager();
org.omg.CORBA.Object obj = rootPOA.servant_to_reference(new BulkCmIRPImpl());
NamingContextExt nc = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
nc.bind( nc.to_name("BindsObj"), obj);
try {
manager.activate();
}
catch(org.omg.PortableServer.POAManagerPackage.AdapterInactive ex) {
throw new RuntimeException();
}

} catch(Exception ex) {
ex.printStackTrace();
}
System.out.println("ORA UP and Running.");
orb.run();
}

}


and my client code is:

			
int i=1;
public class BulkCmIRPClient {

public static void main(String [] args) {

try {
BulkCmIRP bulkCmIRPImpl;
java.util.Properties props = System.getProperties();
props.put("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
props.put("org.omg.CORBA.ORBSingletonClass","org.jacorb.orb.ORBSingleton");
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, props);

String corbaLoc = "corbaloc::10.232.163.139:2222/NameService";
org.omg.CORBA.Object objRef = orb.string_to_object( corbaLoc );

NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

bulkCmIRPImpl = BulkCmIRPHelper.narrow(ncRef.resolve_str("BindsObj"));

} catch (Exception ex) {
System.out.println("Inside catch");
ex.printStackTrace();
}
}

}



And the stack trace I am getting is


org.omg.CORBA.BAD_PARAM: Narrow failed, not a com.BulkCmIRPSystem.BulkCmIRP
at com.BulkCmIRPSystem.BulkCmIRPHelper.narrow(BulkCmIRPHelper.java:54)
at com.BulkCmIRPClient.main(BulkCmIRPClient.java:25)    <<Less
About | Sitemap | Contact