Sample Java DIIOP applications for testing connectivity to a Domino server
The test Java applications provided in this technote can be used to verify that DIIOP is functioning correctly on a Domino server.
Resolving The Problem
Overview of compiling and running DIIOP Java applications
Java applications using DIIOP require NCSO.jar in the classpath. NCSO.jar provides resources for accessing remote Domino servers. This should be copied to the client from the data/domino/java directory of the target Domino server or a Notes client at a release level equal or greater than the Domino server. (Note: If an application is run local to the server, notes.jar is required)
The classpath should be provided when the application is compiled or run. The classpath can be set by running "SET CLASSPATH=<paths to directories and jars>" or by including the argument -cp followed by the path in the command line. The classpath must provide the directories containing the resources of the jdk/jre and the complete file location of NCSO.jar.
For example, "SET CLASSPATH= .;c:\notes\data\domino\java\NCSO.jar " would set a classpath of the current working directory and the .jar file installed on a Notes client. The command line argument "-cp .;c:\notes\data\domino\java\NCSO.jar" would provide the same result.
Compiling Java applications
To compile a Java application. first install a JDK environment. Copy as needed NCSO.jar to the client.
The syntax for compiling a Java application is:
javac [-cp <classpath>] <java_application.java>
javac -cp .;c:\notes\data\domino\java\NCSO.jar platform6.java
The executable java application produced will be a .class file, e.g. platform6.class
Running Java applications
To run an executable java class, install either a JDK or a JRE.
The syntax for running a java application is:
java [-cp <classpath>] <java application.class> <optional arguments>
java platform6 myHostName.server.com
Note: Application names in Java executable class files are case-sensitive.
- Domino 9.0.1 FP5 and later: The file DominoCertsConfig must be in the Java_home directory, providing the path of a Java Key Store containing the root certificates of the target server, and the password of the Java Key Store. See Technote 1968912 "How to implement the updates providing TLS support in standalone Java DIIOP applications" http://www.ibm.com/support/docview.wss?uid=swg21968912
- Domino 9.0.1 FP4 and earlier: TrustedCerts.class from the Domino server must be moved to the same working directory as the CorbaApp. IMPORTANT NOTE: Use of DIIOPS on versions prior to 901 FP5 is not recommended as there is no support for SHA-2 server certificates and only the SSLv3 protocol is available.
Sample application platform6
This example shows if an application can make DIIOP calls on the server. The program returns the OS platform of the server.
The example requires the user to enter the name of the host Domino server and optionally a user name and HTTP password. If user name and password are not supplied, the connection is made anonymously and the server must allow anonymous access on the DIIOP port.
Syntax: java [-cp <classpath>] platform6 <host>
Example: java platform6 myHostName.server.com "My UserName" "MyPassword"
Sample application CorbaApp
This example shows if an application can make DIIOP calls on the server to access a Notes database.
It provides the ability to connect with SSL (HTTPS, DIIOPS) to retrieve the IOR, execute the DIIOP code, or both. The program returns the title of the database specified.
Syntax: java CorbaApp <host> <database> <username> <password> <connectionType>
Example: java CorbaApp "myHost.server.com" "names.nsf" "My UserName" "MyPassword" "HTTPSDIIOP"
|host||The internet host name or ip address of the server,
(for example, myserver.lotus.com)
|database||The database name (for example, names.nsf)|
|username||Specify a Domino username (optional)|
|password||Specify the user's internet password, if any|
|connectionType||Which type of connection to make. The first half is for retrieving the IOR, and the second is for the running the app. You can select to use non-secure ports, secure ports, or any combination thereof.
Possible values are HTTPDIIOP, HTTPSDIIOP, HTTPDIIOPS, HTTPSDIIOPS
More support for:
Software version: 18.104.22.168, 22.214.171.124, 126.96.36.199
Operating system(s): Platform Independent
Software edition: All Editions
Reference #: 1994330
Modified date: 05 September 2018