Problem:

CORBA clients can communicate with an EJB by RMI over IIOP. AppServer includes a tool to create RMI over IIOP stubs ( <AppServer>/bin/iastool –genstubs ). This tool will create stubs matching only with the VisiBroker version bundled with AppServer. The latest available version is VisiBroker 7.0 integrated in AppServer 6.7. The iastool cannot be used to create client stubs for VisiBroker 8.0 or later.

Resolution:

VisiBroker includes a tool to generate RMI over IIOP client stubs directly from Java code ( <VisiBroker>/bin/java2iiop ). The generated stubs match the VisiBroker version used and enable creation of a client also with VisiBroker 8.0 and later.

Attached to the article is a VisiBroker 8.5 client for the EJB cart example included in AppServer ( <AppServer>/examples/ejb/basic/cart ). The client already contains the generated stubs and is ready to be compiled. By replacing the stubs with generated output from java2iiop this example client can also work with other VisiBroker versions.

Steps to run the client:

1.       Deploy and run the cart EJB in AppServer
2.       Compile and run the RMIClient
          a.       Run vbroker.bat/sh of a VisiBroker 8.0 or later
          b.      Compile the example: nmake -f Makefile_java
          c.       Start the client: vbj –DSVCnameroot=namingservice Client

The functionality of the client is the same as of the client in the cart example.

Steps to generate the client stubs using java2iiop:

1.       Run vbroker.bat/sh of a VisiBroker 8.0 or later
2.       Go to the folder <AppServer>/examples/ejb/basic/cart/classes
3.       From there run:  java2iiop -list_files -root_dir <destination-folder> com.borland.examples.ejb.shoppingcart.CartHome

The option –list_files will print the name and path of the generated files on stdout. –root_dir sets the destination folder for the generated client stubs.

The java2iiop tool generates the same classes as iastool –genstub. The only difference is, that iastool generates a Java Archive JAR, while java2iiop generates a set of Java source files.

Incident #2529450