Developing Thin application client code on a server machine

 

Developing Thin application client code on a server machine

You must install WebSphere Application Server before performing this task.

  1. Set the Thin application client environment on non-OS/400 platforms by using the setupCmdLine script, located in:
    install_root\bin\setupCmdLine.bat (on Windows systems)
    install_root/bin/setupCmdLine.sh (on UNIX platforms)
    

    On the OS/400 platform, enter the following command on the CL command line to start the Qshell environment:

    STRQSH

    Enter the following command on the Qshell command line using the dot (.) operator:

    .  /QIBM/ProdData/WebSphere/AppServer/V6/edition/bin/setupClient  [-profileName profilename]

    where edition is either Base or ND.

  2. Run the following Java compilation command to compile your client application:

    On iSeries, enter the following command on the Qshell command line:

    javac -J-Djava.version=1.4 -classpath 
      "$WAS_CLASSPATH:jars_and_classes"
      -extdirs $WAS_EXT_DIRS app_class.java
    On Windows systems, enter:
    "%JAVA_HOME%\bin\javac" -classpath "%WAS_CLASSPATH%; 
    <list of your application jars and classes> " -extdirs %WAS_EXT_DIRS% 
    <your application class>.java
    On UNIX systems, enter:
    $JAVA_HOME/bin/javac -classpath "$WAS_CLASSPATH: 
    <list of your application jars and classes>" -extdirs $WAS_EXT_DIRS 
    <your application class>.java

  3. Run the application client. Perform one of the following methods:

    • Use Java code to call your main class directly:

      On the OS/400 platform, enter the following command on a Qshell command line:

      java ${JAVA_FLAGS_EXT} -classpath  "$WAS_CLASSPATH:jars_and_classes"
       -Djava.naming.provider.url=URL class_name app_parm

      On Windows systems, enter:

      "%JAVA_HOME%\bin\java" %WAS_LOGGING%" 
      -Djava.security.auth.login.config="%WAS_HOME%\properties\wsjaas_client.conf" 
      -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%WAS_EXT_DIRS%" 
      -Djava.naming.provider.url=<an IIOP URL or a corbaloc URL to your 
      WebSphere server machine name>
      -Djava.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory 
      -Dserver.root="%WAS_HOME%" "%CLIENTSAS%" %USER_INSTALL_PROP% 
      -classpath "%WAS_CLASSPATH%;<list of your application jars and classes>" 
      <fully qualified class name to run><your application parameters>

      On UNIX systems, enter:

      "$JAVA_HOME/bin/java" "WAS_LOGGING"
      -Djava.security.auth.login.config="$WAS_HOME/properties/wsjaas_client.conf"
      -Djava.ext.dirs="$JAVA_HOME/jre/lib/ext;%WAS_EXT_DIRS%" 
      -Djava.naming.provider.url=<an IIOP URL or a corbaloc URL to your 
      WebSphere server machine name>
      -Djava.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory -Dserver.root="$WAS_HOME" $USER_INSTALL_PROP "$CLIENTSAS" 
      -classpath "$WAS_CLASSPATH;<list of your application jars and classes>
      <fully qualified class name to run><your application parameters>

    • Use the WebSphere Application Server launcher:

      On the OS/400 platform, enter the following command on a Qshell command line:

      java ${JAVA_FLAGS_EXT} -classpath "$WAS_CLASSPATH:jars_and_classes"   
      -Djava.naming.provider.url=URL 
      com.ibm.ws.bootstrap.WSLauncher class_name app_parm

      On Windows systems, enter:

      "%JAVA_HOME%\bin\java" "WAS_LOGGING"
      -Djava.security.auth.login.config="%WAS_HOME%\properties\wsjaas_client.conf"
      "-Dws.ext.dirs=<list of your application jars and classes;
      %WAS_EXT_DIRS%;%WAS_USER_DIRS%">
      -Djava.naming.provider.url=<an IIOP URL or a corbaloc URL to your 
      WebSphere server machine name>
      -Djava.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory  
      "-Dserver.root=%WAS_HOME%" 
      "%CLIENTSAS%" %USER_INSTALL_PROP% -classpath "%WAS_CLASSPATH%" 
      com.ibm.ws.bootstrap.WSLauncher 
      <fully qualified class name to run><your application parameters>

      On UNIX systems, enter:

      "$JAVA_HOME/bin/java" "WAS_LOGGING"
      -Djava.security.auth.login.config="$WAS_HOME/properties/wsjaas_client.conf"
       "-Dws.ext.dirs=<list of your application jars and classes>
      $WAS_EXT_DIRS;$WAS_USER_DIRS" 
      -Djava.naming.provider.url=<an IIOP URL or a corbaloc URL to your 
      WebSphere server machine name>
      -Djava.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory  
      "-Dserver.root=$WAS_HOME" 
      "$CLIENTSAS" $USER_INSTALL_PROP -classpath "$WAS_CLASSPATH" 
      com.ibm.ws.bootstrap.WSLauncher 
      <fully qualified class name to run><your application parameters>

    For more information on IIOP and corbaloc URLs, see Developing applications that use JNDI.

ExampleSamples gallery


Related tasks
Developing Thin application client code
Developing applications that use JNDI

Related reference
Thin application clients