Skip to main content

VBC 5.2.1: BAD_PARAM exception when using property manager to turn off shared memory

  • February 16, 2013
  • 0 replies
  • 0 views

Problem:

  • Product Name: VisiBroker for C
  • Product Version: 5.2.1
  • Product Component: Shared Memory IPC
  • Platform OS Version: UNIX

VBC 5.2.1: BAD_PARAM exception when using property manager to turn off shared memory after ORB_init ()

Resolution:

The following visibroker property is used to turn off the shared memory use in VisiBroker for C 5.2.1:

vbroker.se.default.local.listener.shm=false

The code looks like this:

myORB = CORBA::ORB_init(argc, argv);
VISPropertyManager_ptr pm = myORB->getPropertyManager();
pm->addProperty("vbroker.se.default.local.listener.shmSize", "false"); // BAD_BARAM

Upon adding exception handling, CORBA:BAD_PARAM exception is witnessed at the above point.

The reason for the BAD_PARAM exception is that the default server engines are set-up during ORB_init() and thus one cannot change their properties (or disable them) after ORB_init() has been called.

The correct way to accomplish this in code is as follows:


int my_argc = 2;
char* my_argv[] = { "Sever",
                    "-Dvbroker.se.default.local.listener.shm=false"};
// note argv[0] is always binary name
CORBA::ORB_var = CORBA::ORB_init(my_argc, my_argv);


Author: Michael Mennis

Old KB# 26412

#Security
#VisiBroker
#VisiBrokerforC