Author: tyrell
Date: Mon Apr 21 22:19:21 2008
New Revision: 15908

Log:

Fixing MASHUP-746 on linux. Refer the JIRA comments for more info.

Modified:
   trunk/mashup/java/modules/distribution/bin/wso2mashup.sh

Modified: trunk/mashup/java/modules/distribution/bin/wso2mashup.sh
==============================================================================
--- trunk/mashup/java/modules/distribution/bin/wso2mashup.sh    (original)
+++ trunk/mashup/java/modules/distribution/bin/wso2mashup.sh    Mon Apr 21 
22:19:21 2008
@@ -15,17 +15,17 @@
 #  limitations under the License.
 
 # ----------------------------------------------------------------------------
-# Main Script for the WSO2 Web Services Application Server [EMAIL PROTECTED]@
+# Main Script for the WSO2 Mashup Server [EMAIL PROTECTED]@
 #
 # Environment Variable Prequisites
 #
 #   WSO2MASHUP_HOME   Home of WSO2 Mashup Server installation. If not set I 
will  try
-#                   to figure it out.
+#                     to figure it out.
 #
-#   JAVA_HOME       Must point at your Java Development Kit installation.
+#   JAVA_HOME         Must point at your Java Development Kit installation.
 #
-#   JAVA_OPTS       (Optional) Java runtime options used when the commands
-#                   is executed.
+#   JAVA_OPTS         (Optional) Java runtime options used when the commands
+#                     is executed.
 #
 # NOTE: Borrowed generously from Apache Tomcat startup scripts.
 # -----------------------------------------------------------------------------
@@ -73,13 +73,13 @@
 [ -z "$WSO2MASHUP_HOME" ] && WSO2MASHUP_HOME=`cd "$PRGDIR/.." ; pwd`
 
 # Set AXIS2_HOME. Needed for One Click JAR Download
-AXIS2_HOME=$WSO2WSAS_HOME
+AXIS2_HOME=$WSO2MASHUP_HOME
 
 # For Cygwin, ensure paths are in UNIX format before anything is touched
 if $cygwin; then
   [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
   [ -n "$WSO2MASHUP_HOME" ] && WSO2MASHUP_HOME=`cygpath --unix 
"$WSO2MASHUP_HOME"`
-  [ -n "$AXIS2_HOME" ] && WSO2WSAS_HOME=`cygpath --unix "$WSO2WSAS_HOME"`
+  [ -n "$AXIS2_HOME" ] && WSO2MASHUP_HOME=`cygpath --unix "$WSO2MASHUP_HOME"`
   [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
 fi
 
@@ -121,13 +121,13 @@
 
 if [ ! -x "$JAVACMD" ] ; then
   echo "Error: JAVA_HOME is not defined correctly."
-  echo " WSO2 WSAS cannot execute $JAVACMD"
+  echo " WSO2 Mashup Server cannot execute $JAVACMD"
   exit 1
 fi
 
 # if JAVA_HOME is not set we're not happy
 if [ -z "$JAVA_HOME" ]; then
-  echo "You must set the JAVA_HOME variable before running WSO2 WSAS."
+  echo "You must set the JAVA_HOME variable before running the WSO2 Mashup 
Server."
   exit 1
 fi
 
@@ -138,7 +138,7 @@
   WSO2MASHUP_CLASSPATH="$WSO2MASHUP_CLASSPATH":$f
 done
 
-#Add the WSAS libs to the classpath
+#Add the Mashup Server libs to the classpath
 for g in "$WSO2MASHUP_HOME"/lib/*.jar
 do
   WSO2MASHUP_CLASSPATH="$WSO2MASHUP_CLASSPATH":$g
@@ -173,16 +173,23 @@
 done
 
 if [ "$CMD" = "--stop" ]; then
-  echo " Stopping WSO2 Mashup Server [EMAIL PROTECTED]@"
-  sh "$WSO2MASHUP_HOME"/bin/shutdown.sh $*
-  exit 0
+  echo " Stopping the WSO2 Mashup Server [EMAIL PROTECTED]@"
+  CMD="stop"
 elif [ "$CMD" = "--start" ]; then
-  echo " Starting WSO2 Mashup Server [EMAIL PROTECTED]@"
-  sh "$WSO2MASHUP_HOME"/bin/startup.sh $*
-  exit 0
+  echo " Starting the WSO2 Mashup Server [EMAIL PROTECTED]@"
+  CMD="start"
 elif [ "$CMD" = "--debug" ]; then
-  CMD="RUN"
+  echo " Starting the WSO2 Mashup Server [EMAIL PROTECTED]@ in debug mode. The 
debug port is $PORT."
+  CMD="debug"
   JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE 
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$PORT"
+else
+  echo " The parameters you entered are invalid. Valid options are;"
+  echo " "
+  echo " --start                               Start the WSO2 Mashup Server"
+  echo " --debug [port]                Start the WSO2 Mashup Server in debug 
mode. A port number can be specified optionally."
+  echo " --stop                                Stop the WSO2 Mashup Server"
+  echo ""
+  exit 0
 fi
 
 # ---------- Handle the SSL Issue with proper JDK version --------------------
@@ -194,18 +201,28 @@
        echo " [ERROR] WSO2 Mashup is supported only on JDK 1.5 and higher"
        exit 1
 elif [ "$jdk_15" ]; then
-   echo " Starting WSO2 Mashup Server [EMAIL PROTECTED]@ (in JDK 1.5 - debug 
mode)"
+   echo " Starting WSO2 Mashup Server [EMAIL PROTECTED]@ (in JDK 1.5)"
    WSO2MASHUP_CLASSPATH="$WSO2MASHUP_HOME/lib/[EMAIL 
PROTECTED]@.jar":$WSO2MASHUP_CLASSPATH
 elif [ "$jdk_16" ]; then
-   echo " Starting WSO2 Mashup Server [EMAIL PROTECTED]@ (in JDK 1.6 - debug 
mode)"
+   echo " Starting WSO2 Mashup Server [EMAIL PROTECTED]@ (in JDK 1.6)"
    echo " [WARNING] WSO2 Mashup has not been fully tested on JDK 1.6"
    WSO2MASHUP_CLASSPATH="$WSO2MASHUP_HOME/lib/[EMAIL 
PROTECTED]@.jar":$WSO2MASHUP_CLASSPATH
 else
    echo " [WARNING] WSO2 Mashup is supported only on JDK 1.5 and higher"
-   echo " Starting WSO2 Mashup Server [EMAIL PROTECTED]@ (in unsupported JDK - 
debug mode)"   
+   echo " Starting WSO2 Mashup Server [EMAIL PROTECTED]@ (in unsupported JDK)" 
  
 fi
 
-WSO2MASHUP_CLASSPATH="$WSO2MASHUP_HOME/lib/patches":"$WSO2MASHUP_HOME/conf":"$WSO2MASHUP_HOME/conf":"$WSO2MASHUP_CLASSPATH"
+
+#---------- Add jar files inside patches folder to classpath ------------------
+
+WSO2MASHUP_PATCH_CLASSPATH=""
+for f in "$WSO2MASHUP_HOME"/lib/patches/*.jar
+do
+  WSO2MASHUP_PATCH_CLASSPATH="$WSO2MASHUP_PATCH_CLASSPATH":$f
+done
+
+WSO2MASHUP_CLASSPATH="$WSO2MASHUP_HOME/lib/patches":"$WSO2MASHUP_PATCH_CLASSPATH":"$WSO2MASHUP_HOME/conf":"$WSO2MASHUP_CLASSPATH"
+
 
 # ----- Execute The Requested Command -----------------------------------------
 
@@ -213,15 +230,15 @@
 
 echo " Using WSO2MASHUP_HOME:   $WSO2MASHUP_HOME"
 echo " Using JAVA_HOME:       $JAVA_HOME"
-echo " Start signal posted to WSO2 Mashup Server (debug mode)."
+echo " Start signal posted to WSO2 Mashup Server."
 echo " Please check the server's log file for startup status."
 
 exec "$JAVACMD" \
 -server \
--Xms128m -Xmx1024m \
+-Xms1024m -Xmx1024m -Xmn1024m -XX:PermSize=256m -XX:MaxPermSize=256m \
 $JAVA_OPTS \
 -classpath "$WSO2MASHUP_CLASSPATH" \
 
-Djava.endorsed.dirs="$WSO2MASHUP_HOME/lib/endorsed":"$JAVA_HOME/jre/lib/endorsed":"$JAVA_HOME/lib/endorsed"
 \
 -Dwso2mashup.home="$WSO2MASHUP_HOME" -Dwso2wsas.home="$WSO2MASHUP_HOME" 
-Dwso2wsas.server.xml="$WSO2MASHUP_HOME/conf/server.xml" -Dserver.script=$0 \
-org.wso2.wsas.Main $* >> "$WSO2MASHUP_HOME"/logs/mashup.out 2>&1 &
+org.wso2.wsas.Main $CMD >> "$WSO2MASHUP_HOME"/logs/mashup.out 2>&1 &
 

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to