Running the wsadmin tool remotely in a Java 2 Platform, Standard Edition environment

The thin administrative client adds JAR files that support administrative client functions that you can use with IBM Developer Kits For the Java Platform.

About this task

For more information about thin administrative clients:
Avoid trouble Avoid trouble: Be aware of the following limitations with thin administrative clients:
  • You cannot run a thin administrative client with the -conntype NONE option.
  • You cannot install SAR files or the edit applications that use an external JACC provider like Tivoli Access Manager.
gotcha

Procedure

  1. Obtain the thin administrative client JAR file and other required files that are required when security is on from the WebSphere Application Server Network Deployment installation. Refer to the Using the Administration Thin Client article for details about the files that you need to perform this task.
  2. Generate the wsadmin.sh or the wsadmin.bat file from the server machine. This file does not ship with the application client.
  3. Copy the wsadmin.sh or the wsadmin.bat file from the server machine. This file does not ship with the application client installation.
  4. Start the wsadmin tool in a non-OSGi environment.
    • Start the wsadmin tool in a non-OSGi environment.

      Example: wsadmin.bat

      @REM wsadmin launcher
      @echo off
      @REM Usage: wsadmin arguments
      setlocal
      @REM was home should point to whatever directory you decide for your thin client environment
      set WAS_HOME=c:\MyThinClient
      set USER_INSTALL_ROOT=%WAS_HOME%
      @REm Java home should point to where you installed java for your thinclient
      set JAVA_HOME="%WAS_HOME%\java"
      set WAS_LOGGING=-Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager -Djava.util.logging.configureByServer=true
      
      if exist "%JAVA_HOME%\bin\java.exe" (
         set JAVA_EXE="%JAVA_HOME%\bin\java"
      ) else (
         set JAVA_EXE="%JAVA_HOME%\jre\bin\java"
      )
      
      @REM CONSOLE_ENCODING controls the output encoding used for stdout/stderr
      @REM console - encoding is correct for a console window
      @REM file - encoding is the default file encoding for the system
      @REM other - the specified encoding is used.  e.g. Cp1252, Cp850, SJIS
      @REM SET CONSOLE_ENCODING=-Dws.output.encoding=console
      
      @REM For debugging the utility itself
      @REM set WAS_DEBUG=-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777
      
      set CLIENTSOAP=-Dcom.ibm.SOAP.ConfigURL=file:"%USER_INSTALL_ROOT%"\properties\soap.client.props
      set CLIENTSAS=-Dcom.ibm.CORBA.ConfigURL=file:"%USER_INSTALL_ROOT%"\properties\sas.client.props
      set CLIENTSSL=-Dcom.ibm.SSL.ConfigURL=file:"%USER_INSTALL_ROOT%"\properties\ssl.client.props
      
      
      @REM the following are wsadmin property 
      @REM you need to change the value to enabled to turn on trace
      set wsadminTraceString=-Dcom.ibm.ws.scripting.traceString=com.ibm.*=all=disabled
      set wsadminTraceFile=-Dcom.ibm.ws.scripting.traceFile="%USER_INSTALL_ROOT%"\logs\wsadmin.traceout
      set wsadminValOut=-Dcom.ibm.ws.scripting.validationOutput="%USER_INSTALL_ROOT%"\logs\wsadmin.valout
      @REM this will be the server host that you will connecting to
      set wsadminHost=-Dcom.ibm.ws.scripting.host=myhost.austin.ibm.com
      
      @REM you need to make sure the port number is the server SOAP port number you want to connect to, in this example the server SOAP port is 8887
      set wsadminConnType=-Dcom.ibm.ws.scripting.connectionType=SOAP
      set wsadminPort=-Dcom.ibm.ws.scripting.port=8887
      
      @REM you need to make sure the port number is the server RMI port number you want to connect to, in this example the server RMI Port is 2815
      @REM set wsadminConnType=-Dcom.ibm.ws.scripting.connectionType=RMI
      @REM set wsadminPort=-Dcom.ibm.ws.scripting.port=2815
      
      @REM specify what language you want to use with wsadmin
      set wsadminLang=-Dcom.ibm.ws.scripting.defaultLang=jacl
      @REM set wsadminLang=-Dcom.ibm.ws.scripting.defaultLang=jython
      
      set SHELL=com.ibm.ws.scripting.WasxShell
      
      :prop
      set WSADMIN_PROPERTIES_PROP=
      if not defined WSADMIN_PROPERTIES goto workspace
      set WSADMIN_PROPERTIES_PROP="-Dcom.ibm.ws.scripting.wsadminprops=%WSADMIN_PROPERTIES%"
      
      :workspace
      set WORKSPACE_PROPERTIES=
      if not defined CONFIG_CONSISTENCY_CHECK goto loop
      set WORKSPACE_PROPERTIES="-Dconfig_consistency_check=%CONFIG_CONSISTENCY_CHECK%"
      
      :loop
      if '%1'=='-javaoption' goto javaoption
      if '%1'=='' goto runcmd
      goto nonjavaoption
      
      :javaoption
      shift
      set javaoption=%javaoption% %1
      goto again
      
      :nonjavaoption
      set nonjavaoption=%nonjavaoption% %1
      
      :again
      shift
      goto loop
      
      
      :runcmd
      
      set C_PATH="%WAS_HOME%\properties;%WAS_HOME%\com.ibm.ws.admin.client_6.1.0.jar;%WAS_HOME%\com.ibm.ws.security.crypto_6.1.0.jar"
      set PERFJAVAOPTION=-Xms256m -Xmx256m -Xj9 -Xquickstart
      
      if "%JAASSOAP%"=="" set JAASSOAP=-Djaassoap=off
      
      @echo off
      
      "%JAVA_EXE%" %PERFJAVAOPTION% %WAS_LOGGING% %javaoption% %CONSOLE_ENCODING% %WAS_DEBUG% "%CLIENTSOAP%" "%JAASSOAP%" "%CLIENTSAS%" "%CLIENTSSL%" %WSADMIN_PROPERTIES_PROP% %WORKSPACE_PROPERTIES% "-Duser.install.root=%USER_INSTALL_ROOT%" "-Dwas.install.root=%WAS_HOME%" %wsadminTraceFile% %wsadminTraceString% %wsadminValOut% %wsadminHost% %wsadminConnType% %wsadminPort% %wsadminLang% -classpath %C_PATH% com.ibm.ws.scripting.WasxShell %*
      
      set RC=%ERRORLEVEL%
      
      goto END
      
      :END
      
      @endlocal
      
      set MYERRORLEVEL=%ERRORLEVEL%
      if defined PROFILE_CONFIG_ACTION exit %MYERRORLEVEL% else exit /b %MYERRORLEVEL%
      
      End of wsadmin.bat 
      [AIX] [HP-UX] [Linux] [Solaris] Example: wsadmin.sh
      ...
      
      #!/bin/sh
      # example wsadmin launcher
      set -x
      
      # WAS_HOME should point to the directory for the thin client
      
      WAS_HOME=/opt/IBM/wsadmin/thinClient
      USER_INSTALL_ROOT=$WAS_HOME
      
      # JAVA_HOME should point to where java is installed for the thin client
      
      JAVA_HOME=/opt/IBM/WebSphere/AppServer610/java
      
      WAS_LOGGING="-Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager -Djava.util.logging.configureByServer=true"
      
      if [ -f ${JAVA_HOME}/bin/java ]; then
          JAVA_EXE="${JAVA_HOME}/bin/java"
      else
          JAVA_EXE="${JAVA_HOME}/jre/bin/java"
      fi
      
      CLIENTSOAP=-Dcom.ibm.SOAP.ConfigURL=file:"$USER_INSTALL_ROOT"/properties/soap.client.props
      CLIENTSAS=-Dcom.ibm.CORBA.ConfigURL=file:"$USER_INSTALL_ROOT"/properties/sas.client.props
      CLIENTSSL=-Dcom.ibm.SSL.ConfigURL=file:"$USER_INSTALL_ROOT"/properties/ssl.client.props
      
      wsadminTraceString=-Dcom.ibm.ws.scripting.traceString=com.ibm.*=all=enabled
      wsadminTraceFile=-Dcom.ibm.ws.scripting.traceFile="$USER_INSTALL_ROOT"/logs/wsadmin.traceout
      wsadminValOut=-Dcom.ibm.ws.scripting.validationOutput="$USER_INSTALL_ROOT"/logs/wsadmin.valout
      
      wsadminHost=-Dcom.ibm.ws.scripting.host=localhost
      wsadminConnType=-Dcom.ibm.ws.scripting.connectionType=SOAP
      wsadminPort=-Dcom.ibm.ws.scripting.port=8880
      wsadminLang=-Dcom.ibm.ws.scripting.defaultLang=jacl
      
      # For debugging the utility itself
      # WAS_DEBUG="-Djava.compiler=NONE -Xdebug -Xnoagent
      -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777"
      
      SHELL=com.ibm.ws.scripting.WasxShell
      
      
      # Parse the input arguments
      isJavaOption=false
      nonJavaOptionCount=1
      for option in "$@" ; do
        if [ "$option" = "-javaoption" ] ; then
           isJavaOption=true
        else
           if [ "$isJavaOption" = "true" ] ; then
              javaOption="$javaOption $option" 
              isJavaOption=false
           else
              nonJavaOption[$nonJavaOptionCount]="$option"
              nonJavaOptionCount=$((nonJavaOptionCount+1))
           fi
        fi
      done
      
      DELIM=" "
      C_PATH="$WAS_HOME/com.ibm.ws.admin.client_6.1.0.jar:$WAS_HOME/com.ibm.ws.security.crypto_6.1.0.jar
      
      #Platform specific args...
      PLATFORM=`/bin/uname`
      case $PLATFORM in
        AIX | Linux | SunOS | HP-UX)
          CONSOLE_ENCODING=-Dws.output.encoding=console ;;
        OS/390)
          EXTRA_D_ARGS="-Dfile.encoding=ISO8859-1 $DELIM-Djava.ext.dirs="$JAVA_EXT_DIRS""
          EXTRA_X_ARGS="-Xnoargsconversion" ;;
      esac
      
      # Set java options for performance
      PLATFORM=`/bin/uname`
      case $PLATFORM in
        AIX)
            PERF_JVM_OPTIONS="-Xms256m -Xmx256m -Xquickstart" ;;
        Linux)
            PERF_JVM_OPTIONS="-Xms256m -Xmx256m -Xj9 -Xquickstart" ;;
        SunOS)
            PERF_JVM_OPTIONS="-Xms256m -Xmx256m -XX:PermSize=40m" ;;
        HP-UX)
            PERF_JVM_OPTIONS="-Xms256m -Xmx256m -XX:PermSize=40m" ;;
        OS/390)
            PERF_JVM_OPTIONS="-Xms256m -Xmx256m" ;;
      esac
      
      "$JAVA_EXE" \
        $EXTRA_X_ARGS \
        $CONSOLE_ENCODING \
        $javaOption \
        $WAS_DEBUG \
        "$CLIENTSAS" \
        "$CLIENTSSL" \
        "$CLIENTSOAP" \
        ${JAASSOAP:+"$JAASSOAP"} \
        -Dconfig_consistency_check="$CONFIG_CONSISTENCY_CHECK" \
        -Dwas.install.root="$WAS_HOME" \
        -Duser.install.root="$USER_INSTALL_ROOT" \
        $EXTRA_D_ARGS \
        $PERF_JVM_OPTIONS \
        $WAS_LOGGING \
        $wsadminTraceFile \
        $wsadminTraceString \
        $wsadminValOut \
        $wsadminHost \
        $wsadminConnType \
        $wsadminPort \
        $wsadminLang \
        -classpath "$C_PATH" \
        $SHELL "${nonJavaOption[@]}"
      
      exit $?
      
      
      ... 
      



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Aug 31, 2013 4:28:44 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=pix&product=was-nd-mp&topic=txml_j2se
File name: txml_j2se.html