Problem:
- Product name: VisiBroker for Java
- Product Version: 7.0
- Product Component: runtime
- Platform/OS Version: All, JBuilder 2006
The easiest way to run a VisiBroker 7.0 Java program outside any IDE environment is to use the vbj launcher. The vbj launcher predefines the parameters needed by VisiBroker to run the specified program as a CORBA server or CORBA client. To know the parameters set by vbj launcher, run "vbj -VBJdebug" at the command line:
D:\\Project2008\\bank_portable\\src>vbj -VBJdebug Loaded Java VM Library C:\\Borland\\VisiBroker7\\jdk\\jdk1.5.0\\jre\\bin\\client\\jvm.dll Java VM Args: version 0x00010002 ignoreUnrecognized is JNI_FALSE number of Options is 14 option[ 0] = "-Djava.endorsed.dirs=C:\\Borland\\VisiBroker7\\bin\\..\\lib\\endorsed" option[ 1] = "-Djavax.rmi.CORBA.StubClass=com.inprise.vbroker.rmi.CORBA.StubImpl" option[ 2] = "-Djavax.rmi.CORBA.UtilClass=com.inprise.vbroker.rmi.CORBA.UtilImpl" option[3]="-Djavax.rmi.CORBA.PortableRemoteObjectClass=com.inprise.vbroker.rmi.CORBA.PortableRemoteObjectImpl" option[ 4] = "-Dorg.omg.CORBA.ORBClass=com.inprise.vbroker.orb.ORB" option[ 5] = "-Dorg.omg.CORBA.ORBSingletonClass=com.inprise.vbroker.orb.ORBSingleton" option[ 6] = "-Dvbroker.orb.procId=3672" option[ 7] = "-Dapplication.home=C:\\Borland\\VisiBroker7\\bin\\.." option[ 8] = "-Dborland.enterprise.licenseDir=C:\\Borland\\VisiBroker7\\bin\\..\\var" option[ 9] = "-Dborland.enterprise.licenseDefaultDir=C:\\Borland\\VisiBroker7\\bin\\..\\license" option[10] = "-Dvbroker.agent.port=14070" option[11] = "-Dvbroker.orb.admDir=C:\\Borland\\VisiBroker7\\var\\vbroker\\adm" option[12] = "-Djava.net.preferIPv4Stack=false" option[13] = "-Djava.class.path=C:\\Borland\\VisiBroker7\\lib\\patches;C:\\Borland\\VisiBroker7\\lib\\vbejb.jar;...
Alternatively, instead of using the vbj launcher, you may invoke the java executable to run the program directly, and that, is the main intention of this article.
Resolution:
Using the bank_naming example (included in VisiBroker 7 distribution) for illustration:
For the client program, vbjorb.jar or vbjclientorb.jar and log4j.jar will have to be included in the classpath and the following JVM properties specified:
-Dorg.omg.CORBA.ORBClass=com.inprise.vbroker.orb.ORB -Dorg.omg.CORBA.ORBSingletonClass=com.inprise.vbroker.orb.ORBSingleton -Dvbroker.agent.enableLocator=false -DORBInitRef=NameService=corbaloc::143.186.141.142:33333/NameServiceFor the server program, vbjorb.jar, log4j.jar, lm.jar and sanct6.jar will have to be included in its classpath and the following JVM properties specified:
-Dorg.omg.CORBA.ORBClass=com.inprise.vbroker.orb.ORB -Dorg.omg.CORBA.ORBSingletonClass=com.inprise.vbroker.orb.ORBSingleton -Dborland.enterprise.licenseDir=C:\\Borland\\VisiBroker7\\var -Dborland.enterprise.licenseDefaultDir=C:\\Borland\\VisiBroker7\\license -Dvbroker.orb.admDir=C:\\Borland\\VisiBroker7\\var\\vbroker\\adm -Dvbroker.agent.enableLocator=false -DORBInitRef=NameService=corbaloc::143.186.141.142:33333/NameServiceTo turn on debug logging, add two more JVM properties:
-Dvbroker.log.enable=true -Dvbroker.log.logLevel=7
Using the JBuilder 2006
The JBuilder 2006 can be set up to run a VisiBroker application through the Java executable. Similar to the independent Java program, you need to specify the path of the VisiBroker libraries, as well as the properties to be passed as JVM parameters.The libraries are specified through Project Properties -> Required Libraries tab.
The JVM properties are specified through Runtime Configurations -> VM parameters field.
The JVM properties are specified through Runtime Configurations -> VM parameters field.
Attachment
Attached to this article is an archive file which embeds screenshots of the JBuilder 2006 configuration for the libraries as well as runtime JVM properties. Also included are VisiBroker logs and a network packet capture that can be viewed using Wireshark. You could download from here.
#VisiBroker
#Security
