Visibroker idl2java and vbjc error

visibroker, idl2java, vbjc error, solution

If you are using Visibroker, and idl2java fails with this error: : unrecoverable error launching tool; aborting, then this has to do with the PATH and CLASSPATH variable setting on your machine. Also, from the BDP help page, the right way of launching Java-written CORBA servers and clients is using the vbj and vbjc files. These files are executables on Windows, but on other operating systems (*nixes), these two files are shell scripts which set the Java’s system properties and the required Class variable names before invoking the JVM. It is not needed to use these files on Windows, if you know what should be the parameters that should be passed. Also, another common error seen when launching the vbjc is vbjc requires JDK 1.1.6 or above installed. This will be seen even if you have the latest SUN’s JDK installed or even if you use BDP’s JDK. It is suggested that you always use Borland’s JDK for reasons only known to Borland.

To fix the above mentioned errors, you can have a batch file (or a shell script) which has settings like this: @ECHO OFF
SET CLASSPATH=E:\BDP\lib\vbdev.jar;E:\BDP\lib\vbjdev.jar;E:\BDP\lib\vbjorb.jar;E:\BDP\jdk\jdk1.4.2\lib\tools.jar;%CLASSPATH%
SET PATH=E:\BDP\jdk\jdk1.4.2\bin;E:\BDP\jdk\jdk1.4.2\jre\bin\;E:\BDP\bin\;%PATH%

The JDK’s bin directory should preced the JRE’s bin directory. I found this by trial and error. Once you set these settings, you should be able to use both idl2java and vbjc.

Coming to the parameters that get passed to (say)a Java client by the vbjc, it looks something like this (again from the BDP’s bank_agent example): java -Djava.endorsed.dirs=E:\BDP\lib\endorsed -Djavax.rmi.CORBA.StubClass=com.inprise.vbroker.rmi.CORBA.StubImpl -Djavax.rmi.CORBA.UtilClass=com.inprise.vbroker.rmi.CORBA.UtilImpl -Djavax.rmi.CORBA.PortableRemoteObjectClass=com.inprise.vbroker.rmi.CORBA.PortableRemoteObjectImpl -Dorg.omg.CORBA.ORBClass=com.inprise.vbroker.orb.ORB -Dorg.omg.CORBA.ORBSingletonClass=com.inprise.vbroker.orb.ORBSingleton -Dvbroker.agent.port=18656 -Dborland.enterprise.licenseDir=E:\BDP\var -Dborland.enterprise.licenseDefaultDir=E:\BDP\license -Dvbroker.orb.procId=3008 -Dapplication.home=E:\BDP -Djava.class.path=E:\BDP\lib\vbdev.jar;E:\BDP\lib\vbjdev.jar;E:\BDP\lib\vbjorb.jar;E:\BDP\jdk\jdk1.4.2\lib\tools.jar;E:\BDP\lib\vbejb.jar;E:\BDP\lib\asrt.jar;E:\BDP\lib\jdsserver.jar;E:\BDP\lib\xmlrt.jar;E:\BDP\lib\vbjorb.jar;E:\BDP\lib;E:\BDP\bin;E:\BDP\lib\lm.jar;E:\BDP\lib\EccpressoAll.jar;E:\BDP\lib\flexlm.jar;E:\BDP\lib\sanct2.jar;E:\BDP\lib\mail.jar;E:\BDP\lib\dom4j.jar;E:\BDP\lib\log4j.jar;E:\BDP\lib\xmlParserAPIs.jar;E:\BDP\lib\xercesImpl.jar;E:\BDP\lib\jsse.jar;E:\BDP\lib\jcert.jar;E:\BDP\lib\jnet.jar;E:\BDP\lib\jaas.jar;E:\BDP\lib\vbsec.jar;E:\BDP\lib\jce1_2_1.jar;E:\BDP\lib\sunjce_provider.jar;E:\BDP\lib\local_policy.jar;E:\BDP\lib\US_export_policy.jar;E:\BDP\lib\tomcat\common\servlet.jar;.;e:\bdp\jdk\jdk1.4.2\lib\tools.jar;.; Client
If you see, the osagent port is passed to the JVM. Another important thing to note is this line:-Dorg.omg.CORBA.ORBClass=com.inprise.vbroker.orb.ORB. This line basically tells the JVM that the ORB class to be used is Visibroker’s ORB and not the default SUN’s ORB that is shipped with the JVM. I have tested this with Visibroker 6.0, but this should work for the higher versions of Visibroker too. If it doesn’t please let me know and I will try to provide the instructions for the higher versions too.

A new way of writing client-side browser code

If lambdas are something that you have used in callbacks in the Javascript code or have used a list of functions in a list as subscribers to an event, then you might benefit from looking at FlapJax. FlapJax can be used to write client side browser code using behaviors. I am not familiar with Aspect programming, so I don’t know if this equates to that, but the idea is very nice. There are behaviors and events that are created as part of the system (the HTML page). Any change in the behavior automatically gets reflected in all the subscribers(for the lack of a better word) of the behavior. Any expression containing a behavior also behaves as another behavior. Not impressed ? Even better, you can write code in JavaScript and FlapJax side-by-side. The FlapJax compiler ensures that the lifting of the JavaScript functions happen automatically. This means that existing JavaScript code can be incrementally changed. What are the potential applications ? Hmm, I can think of a reddit style system wherein the resultant HTML can be continuously updated as the rankings change (this of course will need a server-side persistence layer aka behavior whose changes reflect on the final HTML). Hmm, may be I can suggest this to the good people behind this language.