📄 debug-wso2is.sh
字号:
#!/bin/sh# ----------------------------------------------------------------------------# Copyright 2005,2006 WSO2, Inc. http://www.wso2.org## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.# ----------------------------------------------------------------------------# Script for remort debugging of the WSO2 Identity Solution ${wso2is_version}## Environment Variable Prequisites## WSO2IS_HOME Home of WSO2 IS installation. If not set I will try# to figure it out.## JAVA_HOME Must point at your Java Development Kit installation.## JAVA_OPTS (Optional) Java runtime options used when the commands# is executed.# $1 Must remort port## NOTE: Borrowed generously from Apache Tomcat startup scripts.# -----------------------------------------------------------------------------DARWIN_TOOLS=""# OS specific support. $var _must_ be set to either true or false.cygwin=false;darwin=false;os400=false;mingw=false;case "`uname`" inCYGWIN*) cygwin=true;;MINGW*) mingw=true;;OS400*) os400=true;;Darwin*) darwin=true if [ -z "$JAVA_VERSION" ] ; then JAVA_VERSION="CurrentJDK" else echo "Using Java version: $JAVA_VERSION" fi if [ -z "$JAVA_HOME" ] ; then JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home DARWIN_TOOLS=$JAVA_HOME/Classes/Classes.jar fi ;;esac# resolve links - $0 may be a softlinkPRG="$0"while [ -h "$PRG" ]; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '.*/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`/"$link" fidone# Get standard environment variablesPRGDIR=`dirname "$PRG"`# Only set WSO2IS_HOME if not already set[ -z "$WSO2IS_HOME" ] && WSO2IS_HOME=`cd "$PRGDIR/.." ; pwd`# Set AXIS2_HOME. Needed for One Click JAR DownloadAXIS2_HOME=$WSO2IS_HOME# For Cygwin, ensure paths are in UNIX format before anything is touchedif $cygwin; then [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` [ -n "$WSO2IS_HOME" ] && WSO2IS_HOME=`cygpath --unix "$WSO2IS_HOME"` [ -n "$AXIS2_HOME" ] && WSO2IS_HOME=`cygpath --unix "$WSO2IS_HOME"` [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`fi# For OS400if $os400; then # Set job priority to standard for interactive (interactive - 6) by using # the interactive priority - 6, the helper threads that respond to requests # will be running at the same priority as interactive jobs. COMMAND='chgjob job('$JOBNAME') runpty(6)' system $COMMAND # Enable multi threading QIBM_MULTI_THREADED=Y export QIBM_MULTI_THREADEDfi# For Migwn, ensure paths are in UNIX format before anything is touchedif $mingw ; then [ -n "$WSO2IS_HOME" ] && WSO2IS_HOME="`(cd "$WSO2IS_HOME"; pwd)`" [ -n "$JAVA_HOME" ] && JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" [ -n "$AXIS2_HOME" ] && WSO2IS_HOME="`(cd "$WSO2IS_HOME"; pwd)`" # TODO classpath?fiif [ -z "$JAVACMD" ] ; then if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi else JAVACMD=java fifiif [ ! -x "$JAVACMD" ] ; then echo "Error: JAVA_HOME is not defined correctly." echo " WSO2 WSAS cannot execute $JAVACMD" exit 1fi# if JAVA_HOME is not set we're not happyif [ -z "$JAVA_HOME" ]; then echo "You must set the JAVA_HOME variable before running WSO2 WSAS." exit 1fi# update classpathWSO2IS_CLASSPATH=""for f in "$WSO2IS_HOME"/lib/*.jardo WSO2IS_CLASSPATH="$WSO2IS_CLASSPATH":$fdoneWSO2IS_CLASSPATH="$JAVA_HOME/lib/tools.jar":"$WSO2IS_CLASSPATH":"$CLASSPATH":"$DARWIN_TOOLS"# For Cygwin, switch paths to Windows format before running javaif $cygwin; then JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"` WSO2IS_HOME=`cygpath --absolute --windows "$WSO2IS_HOME"` AXIS2_HOME=`cygpath --absolute --windows "$WSO2IS_HOME"` CLASSPATH=`cygpath --path --windows "$CLASSPATH"` JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"`fi# --- THIS SCRIPT ONLY USES FOR DEBUGGING PURPOSES AND TEST ENVIRONMENTS. ----CMD="--debug"PORT=$1if [ "$CMD" = "--stop" ]; then sh "$WSO2IS_HOME"/bin/shutdown.sh $* exit 0elif [ "$CMD" = "--start" ]; then sh "$WSO2IS_HOME"/bin/startup.sh $* exit 0elif [ "$CMD" = "--debug" ]; then if [ "$PORT" = "" ]; then echo " Please specify the debug port after the debug script to run" exit 1 fi CMD="RUN" JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$PORT"fi# ---------- Handle the SSL Issue with proper JDK version --------------------jdk_15=`$JAVA_HOME/bin/java -version 2>&1 | grep 1.5`jdk_16=`$JAVA_HOME/bin/java -version 2>&1 | grep 1.6`jdk_14=`$JAVA_HOME/bin/java -version 2>&1 | grep 1.4`if [ "$jdk_15" ]; then WSO2IS_CLASSPATH="$WSO2IS_HOME/lib/bcprov-jdk15-${bcprov_jdk15_version}.jar":$WSO2IS_CLASSPATHelif [ "$jdk_14" ]; then WSO2IS_CLASSPATH="$WSO2IS_HOME/lib/bcprov-jdk13-${bcprov_jdk13_version}.jar":$WSO2IS_CLASSPATHelif [ "$jdk_16" ]; then echo " [WARNING] WSO2 WSAS has not been fully tested on JDK 1.6" WSO2IS_CLASSPATH="$WSO2IS_HOME/lib/bcprov-jdk15-${bcprov_jdk15_version}.jar":$WSO2IS_CLASSPATHelse echo " [ERROR] WSO2 WSAS is supported only on JDK 1.4 and higher" exit 1fi#---------- Add jar files inside patches folder to classpath ------------------WSO2IS_PATCH_CLASSPATH=""for f in "$WSO2IS_HOME"/lib/patches/*.jardo WSO2IS_PATCH_CLASSPATH="$WSO2IS_PATCH_CLASSPATH":$fdoneWSO2IS_CLASSPATH="$WSO2IS_HOME/lib/patches":"$WSO2IS_PATCH_CLASSPATH":"$WSO2IS_HOME/conf":"$WSO2IS_CLASSPATH"# ----- Execute The Requested Command -----------------------------------------cd "$WSO2IS_HOME"exec "$JAVACMD" \$JAVA_OPTS \-classpath "$WSO2IS_CLASSPATH" \-Djava.endorsed.dirs="$WSO2IS_HOME/lib/endorsed":"$JAVA_HOME/jre/lib/endorsed":"$JAVA_HOME/lib/endorsed" \-Dwso2wsas.home="$WSO2IS_HOME" -Dwso2wsas.server.xml="$WSO2IS_HOME/conf/server.xml" -Dserver.script=$0 \org.wso2.wsas.Main --debug $1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -