Skip to main content

CORBA process within Tomcat can not get "RootPOA" object.

  • May 17, 2013
  • 0 replies
  • 0 views

Summary CORBA process within Tomcat can not get "RootPOA" object.
Article Number 15420
Environment Orbix 5.x Orbix 6.x
Question/Problem Description CORBA process within Tomcat can not get "RootPOA" object.
How to initialize an Orbix ORB properly inside a Servlet of a JSP?
Clarifying Information
Error Message
Defect/Enhancement Number
Cause
Resolution

Orbix ORB initialization requires different parameters to be passed during the ORB.init() call. Some of these arguments are passed as properties, while others are passed as a string array.

In a strait java program, these arguments are passed thorough the command line as the main "args". However, since this can not be done in case of servlets or JSPs, it is the programmer's responsibility to pass the appropriate values of these arguments, either by hardcoding them in the code, or by reading these parameters through JAVA properties.

Bellow is an example how to pass such arguments directly inside the code: 

// These are the JAVA properties needed to initialize an Orbix ORB

java.util.Properties props = System.getProperties();
props.put("org.omg.CORBA.ORBClass", "com.iona.corba.art.artimpl.ORBImpl");
props.put("org.omg.CORBA.ORBSingletonClass", "com.iona.corba.art.artimpl.ORBSingleton");

// These are the ORB parameters that need to be passed as a string array

// It should contain at least the following configurations. Note the format in the string array, which is "-<ORB config> <ORB config value>": 

// "ORBdomain_name": The name of the domain, which need to match the name of the configuration file, the ".cfg" file

// "ORBname": The name of the ORB, which should match the ORB configuration scope inside the ORBIX configuration file

// "ORBconfig_domains_dir": The path where the ORB configuration file is located.

String[] args = new String[]{"-ORBdomain_name", "sample-domain" , "-ORBname", "sample_orb", "-ORBconfig_domains_dir", "C:/data/business/orbix/etc/domains"},

ORB orb = ORB.init(args, props);

org.omg.CORBA.Object poa_obj = orb.resolve_initial_references("RootPOA");

Workaround
Notes
Attachment
Created date: 06 September 2011
Last Modified: 13 February 2013
Last Published: 23 June 2012
First Published date: 10 September 2011

#KnowledgeDocs
#Orbix