+

Search Tips   |   Advanced Search

Run the IBM Thin Client for EJB

An EJB Client is a Remote Method Invocation over Internet Inter-ORB Protocol (RMI-IIOP) Java Platform, Standard Edition (Java SE) application that accesses remote Enterprise Java Beans from a server through JNDI look up. IBM Thin Client for EJB offers a smaller footprint and is easy to deploy to a Java SE environment and an Eclipse Rich Client Platform (RCP) environment. We can bundle the IBM Thin Client for EJB library using the WebSphere Application Server installation or the Application Client for WAS installation with the application. The IBM Thin Client for EJB also extends the choice of Java SE runtime. It can be run in the Java Runtime Environment (JRE) that is packaged with the WAS product, the JRE that is downloaded from the Oracle website, or the JRE that is downloaded from the HP website.

The IBM ORB implementation library is required if the IBM Thin Client for EJB is running with a non-IBM product JRE on a non-IBM product platform. For example, running the IBM Thin Client for EJB with Sun icrosystems JRE on Windows, Linux, or Solaris, and with the HP JRE on HP-UX. The IBM-provided Solaris hybrid and HP hybrid JRE are not considered non-IBM product JRE environments.

The IBM Thin Client for EJB can access version 2.x and version 3.x EJB on the WAS using the JNDI lookup, but it cannot access version 3.x EJB through resource injection. Resource injection is supported if the client application is a Java EE Application Client running within the Java EE Application Client Container.

Before we set up an EJB Thin Client environment, obtain the Java archive (JAR) file for the EJB Thin Client for WAS. To obtain the EJB Thin Client for WAS, install WAS or Application Client. The EJB Thin Client for WAS file, com.ibm.ws.ejb.thinclient_8.5.0.jar(ZOS) com.ibm.ws.ejb.thinclient.zos_8.5.0.jar, is located in the app_server_root\runtimes directory. (ZOS) Use the com.ibm.ws.ejb.thinclient.zos_8.5.0.jar for any client running on z/OS. Use the com.ibm.ws.ejb.thinclient.jar for any client that runs on distributed platforms. Determining the client to use depends on the client platform, and not the platform of the server we are connecting to.

Copy the Java archive (JAR) file for the IBM Thin Client for EJB with WAS product, com.ibm.ws.ejb.thinclient_8.5.0.jar(ZOS) com.ibm.ws.ejb.thinclient.zos_8.5.0.jar and the endorsed_apis_8.5.0.jar files, to other machines to create a lightweight client environment that enables communications with the products. Copies of the IBM Thin Client for EJB are subject to the same terms and conditions of the license agreement for the WebSphere product where obtained the Thin Client for EJB. Refer to the license agreements for correct usage and other limitations.

Copy the app_server_root\runtimes\endorsed\endorsed_apis_8.5.0.jar file into the default directory, JAVA_JRE\lib\endorsed. Alternatively, we can use the java.endorsed.dirs property to specify a directory of our choice. If we choose to use an alternative directory, it is a best practice to only include the endorsed_apis JAR file.

The IBM Thin Client for EJB with WAS runs on distributed operating systems with JDK support. When using the IBM Thin Client for EJB as a standalone Java SE application with a non-IBM product JRE, we must override the default ORB implementation for the JRE through one of following methods:

When running the IBM Thin Client for EJB as an Eclipse RCP application, IBM recommends to use method two, to override the default JRE ORB implementation.

When running the IBM Thin Client for EJB, and the -Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager command line option is used, a ClassDefNotFoundError error is thrown. The use of WsLogManager is not supported in the IBM Thin Client for EJB, but we can use another Java logging manager.

Run the IBM Thin Client for EJB, by completing the following steps.


Tasks

  1. Invoke the client application. Run the following Java command:

    (Windows)

    <java_install_root>\bin\java  
    -classpath com.ibm.ws.ejb.thinclient_8.5.0.jar;<list_of_your_application_jars_and_classes> 
    -Djava.naming.provider.url=iiop://<your_application_server_machine_name>
    <fully_qualified_class_name_to_run>
    

    Add the following system properties to the Java command if we want authentication and SSL enabled:(AIX) (HPUX) (Solaris) (Linux)

    <java_install_root>/bin/java  
    -classpath com.ibm.ws.ejb.thinclient_8.5.0.jar:<list_of_your_application_jars_and_classes> 
    -Djava.naming.provider.url=iiop://<your_application_server_machine_name> 
    -Dcom.ibm.SSL.ConfigURL=file:///home/user1/ssl.client.props
    -Dcom.ibm.CORBA.ConfigURL=file:///home/user1/sas.client.props
    <fully_qualified_class_name_to_run>
    

    (ZOS)

    export LIBPATH=<app_server_root>/lib:$LIBPATH
    <java_install_root>/bin/java  
    -classpath com.ibm.ws.ejb.thinclient.zos_8.5.0.jar:<list_of_your_application_jars_and_classes> 
    -Djava.naming.provider.url=iiop://<your_application_server_machine_name> 
    -Dcom.ibm.SSL.ConfigURL=file:///home/user1/ssl.client.props
    -Dcom.ibm.CORBA.ConfigURL=file:///home/user1/sas.client.props
    <fully_qualified_class_name_to_run>
    

  2. Provide IIOP authentication configuration and Client SSL Configuration. Add the following system properties to the Java command:

    -Dcom.ibm.SSL.ConfigURL=file:///home/user1/ssl.client.props
    -Dcom.ibm.CORBA.ConfigURL=file:///home/user1/sas.client.props
    

    We can obtain the ssl.client.props file and sas.client.props file from the WAS installation and modify the file to suit the environment. We must, at a minimum, update the location of the key files in the ssl.client.props file to the match location of our target environment. For example,

    -Dcom.ibm.ssl.keyStore=/home/user1/etc/key.p12 
    -Dcom.ibm.ssl.trustStore=/home/user1/etc/trust.p12
    
    Recommended SSL configuration settings when running the application with a non-IBM product JRE:
    com.ibm.ssl.protocol=SSL
    com.ibm.ssl.trustManager=SunX509
    com.ibm.ssl.keyManager=SunX509
    com.ibm.ssl.contextProvider=SunJSSE
    
    com.ibm.ssl.keyStoreType=JKS
    com.ibm.ssl.keyStoreProvider=SUN
    com.ibm.ssl.keyStore=/home/user1/etc/key.jks
    
    com.ibm.ssl.trustStoreType=JKS
    com.ibm.ssl.trustStoreProvider=SUN
    com.ibm.ssl.trustStore=/home/user1/etc/trust.jks
    

    The key store file and trust store file must be created using the Java keytool utility before the application runs. The automatic key file generation is not supported with a non-IBM product JRE.

    We must override the default ORB implementation of the non-IBM product JRE with the com.ibm.ws.orb_8.5.0.jar file, or add it to the classpath.

  3. Run the client application:

    • Enter the following command if we have copied the endorsed_apis_8.5.0.jar file into the JAVA_JRE\lib\endorsed default directory; for example:

      (Windows) (ZOS)

      %JAVA_HOME%\bin\java -Dcom.ibm.SSL.ConfigURL=file:\\\home\sample\ssl.client.props <your_client_application>
      

      (AIX) (HPUX) (Solaris) (Linux) (iSeries)

      $JAVA_HOME/bin/java -Dcom.ibm.SSL.ConfigURL=file:///home/sample/ssl.client.props <your_client_application>
      
    • Enter the following command if we have copied the endorsed_apis_8.5.0.jar file into a directory other than the default JAVA_JRE\lib\endorsed directory; for example:

      (Windows) (ZOS)

      %JAVA_HOME%\bin\java 
      -Djava.endorsed.dirs=<directory_that_includes_endorsed_apis_8.5.0.jar> 
      -Dcom.ibm.SSL.ConfigURL=file:\\\home\sample\ssl.client.props <your_client_application>
      

      (AIX) (HPUX) (Solaris) (Linux) (iSeries)

      $JAVA_HOME/bin/java 
      -Djava.endorsed.dirs=<directory_that_includes_endorsed_apis_8.5.0.jar>
      -Dcom.ibm.SSL.ConfigURL=file:///home/sample/ssl.client.props <your_client_application>
      


What to do next

Enable trace for the IBM Thin Client for EJB by adding the following to the Java command.
  -Dcom.ibm.ejs.ras.lite.traceSpecification=*=all

  • Example 1: Configuring basic authentication and identity assertion
  • Use JMS to connect to a WAS default messaging provider messaging engine
  • ssl.client.props client configuration file