Skip to main content

Config file for naming service cannot understand $VARIABLE_NAME

  • February 16, 2013
  • 0 replies
  • 0 views

Problem:

 
Product: VisiBroker
Platform: All Plarforms
When launching Naming Service with the command below:
 
nameserv -config properties.cfg & > NameServ.ior
 
The content of the property file as follows:
 
vbroker.se.iiop_tp.scm.iiop_tp.listener.port=$NS_PORT
 
This throws the exception below:
 
ExtFactory fails!org.omg.CORBA.INITIALIZE: Couldn"t not resolve ServerManager:org.omg.CORBA.INTERNAL: org.omg.CORBA.BAD_PARAM:java.lang.NumberFormatException: $NS_PORT minor code: 0 completed: Nominor code: 0 completed: No minor code: 0 completed: No
at com.inprise.vbroker.ServerManager.Init.initManager(Init.java:64)
at com.inprise.vbroker.ServerManager.Init.init_complete(Init.java:101)
at com.inprise.vbroker.orb.ORB.completeInitializingServices(ORB.java:1308) at com.inprise.vbroker.orb.ORB.initialize(ORB.java:1173)
at com.inprise.vbroker.orb.ORB.set_parameters(ORB.java:1318)
at org.omg.CORBA.ORB.init(ORB.java:329) at com.inprise.vbroker.naming.ExtFactory.main(ExtFactory.java:127)
[1] Done nameserv -config properties.cfg >NameServ.ior

Resolution:

Passing variable inside a config file for nameserv is not supported. The reason for this is that the JVM cannot resolve values for variables, resulting in nameserv throwing the "CORBA.BAD_PARAM" exception. This is a limitation of the JVM. However, this varaiable can be interpreted via the command parameter as follows:
 
nameserv -J-Dvbroker.se.iiop_tp.scm.iiop_tp.listener.port=$NS_PORT
 
This command can be put inside a shell script since the shell is able to resolve values for variables.
 
This issue could occur on any VisiBroker application or services that uses a property file. The same resolution is applicable.

#Security
#VisiBroker