<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
<!--

/*
  The original subSilver Theme for phpBB version 2+
  Created by subBlue design
  http://www.subBlue.com

  NOTE: These CSS definitions are stored within the main page body so that you can use the phpBB2
  theme administration centre. When you have finalised your style you could cut the final CSS code
  and place it in an external file, deleting this section to save bandwidth.
*/


 /* General page style. The scroll bar colours only visible in IE5.5+ */
body {
        background-color: #E5E5E5;
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 11;
        color: #000000;
}

/* General font families for common tags */
font,th,td,p { font-family: Verdana, Arial, Helvetica, sans-serif }
p, td                { font-size : 11; color : #000000; }
a:link,a:active,a:visited { color : #006699; }
a:hover                { text-decoration: underline; color : #DD6900; }
hr        { height: 0px; border: solid #D1D7DC 0px; border-top-width: 1px;}
h1,h2                { font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; font-size : 22px; font-weight : bold; text-decoration : none; line-height : 120%; color : #000000;}


/* This is the border line & background colour round the entire page */
.bodyline        { background-color: #FFFFFF; border: 1px #98AAB1 solid; }


/* General text */
.gen { font-size : 12px; }
.genmed { font-size : 11px; }
.gensmall { font-size : 10px; line-height: 12px}
.gen,.genmed,.gensmall { color : #000000; }
a.gen,a.genmed,a.gensmall { color: #006699; text-decoration: none; }
a.gen:hover,a.genmed:hover,a.gensmall:hover        { color: #DD6900; text-decoration: underline; }


/* Forum title: Text and link to the forums used in: index.php */
.forumlink                { font-weight: bold; font-size: 12px; color : #006699; }
a.forumlink         { text-decoration: none; color : #006699; }
a.forumlink:hover{ text-decoration: underline; color : #DD6900; }


/* The content of the posts (body of text) */
.postbody { font-size : 12px; line-height: 18px}
a.postlink:link        { text-decoration: none; color : #006699 }
a.postlink:visited { text-decoration: none; color : #5493B4; }
a.postlink:hover { text-decoration: underline; color : #DD6900}


/* Quote & Code blocks */
.code {
        font-family: Courier, 'Courier New', sans-serif; font-size: 11px; color: #006600;
        background-color: #FAFAFA; border: #D1D7DC; border-style: solid;
        border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
}

.quote {
        font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #444444; line-height: 125%;
        background-color: #FAFAFA; border: #D1D7DC; border-style: solid;
        border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
}

-->
</style>
</head>
        <body>

        <div class="postbody">Hi!<br />
1-Normally, you've to use the shell ping.sh, which isn't operational on quickstart 2.2. Youv've to had '!' into two test. The correct ping.sh (adds are on red):<br />
</span><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr>           <td><span class="genmed"><b>Quote:</b></span></td>        </tr>        <tr>          <td class="quote">#!/bin/sh<br />
<br />
RepScript=`dirname $0`<br />
RepCourant=`pwd`<br />
<br />
<br />
######################<br />
#   ENV VARIABLES<br />
######################<br />
<br />
echo "Setting Petals environment"<br />
<br />
if [<span style="color: red"> !</span> -d "$JAVA_HOME" ]<br />
then<br />
        echo "The JAVA_HOME variable is not properly set. Please set it in your environment."<br />
        exit 1<br />
fi<br />
<br />
if [<span style="color: red"> !</span> -d "$PETALS_HOME" ]<br />
then<br />
        PETALS_HOME="$RepCourant/$RepScript/.."<br />
        <span style="color: red">export PETALS_HOME</span><br />
fi<br />
<br />
if [ ! -f "$PETALS_HOME/conf/server.properties" ]<br />
then<br />
        echo "The PETALS_HOME environment variable is not set correctly. Please set it in your environment with a correct value."<br />
        exit 2<br />
fi<br />
<br />
PATH="$JAVA_HOME/bin:$PATH"<br />
export PATH<br />
<br />
java -version<br />
echo ""<br />
<br />
<br />
######################<br />
#   ARGUMENTS<br />
######################<br />
<br />
cd "$PETALS_HOME/bin"<br />
<br />
Silence=false<br />
while getopts :hv:Sv options<br />
do<br />
        case ${options} in<br />
                h)<br />
                        echo "The ping.sh script is used to determine if Petals is started."<br />
                        echo "usage : ping [-h] [-S]"<br />
                        echo "     -h : prints the help message"<br />
                        echo "     -S : active the silent mode"<br />
                        exit 0;<br />
                        ;;<br />
                S)<br />
                        Silence=true<br />
                        ;;<br />
                ?)<br />
                        echo "usage : ping [-h] [-S]"<br />
                        exit 2<br />
                        ;;<br />
        esac<br />
done<br />
<br />
pingResult=`java -Xmx128m -jar server.jar version`<br />
<br />
echo $pingResult | grep "Petals JBI Container - version:" >/dev/null 2>/dev/null<br />
active=$?<br />
<br />
cd "$RepCourant"<br />
<br />
if [ $active -eq 0 ]<br />
then<br />
        if [ $Silence != true ]<br />
        then<br />
                echo "Petals RUNNING"<br />
        fi<br />
        exit 0<br />
else<br />
        if [ $Silence != true ]<br />
        then<br />
                echo "Petals STOPPED"<br />
        fi<br />
        exit 1<br />
fi<br />
</td>        </tr></table><span class="postbody"><br />
2-that's right : to get the version, today we need the PEtALS JMX Server on:<br />
</span><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr>           <td><span class="genmed"><b>Code:</b></span></td>        </tr>        <tr>          <td class="code">/*<br />
&nbsp; &nbsp; &nbsp;* &#40;non-Javadoc&#41;<br />
&nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp;* @see org.ow2.petals.launcher.PetalsLauncher#version&#40;&#41;<br />
&nbsp; &nbsp; &nbsp;*/<br />
&nbsp; &nbsp; public void version&#40;&#41; throws Exception &#123;<br />
&nbsp; &nbsp; &nbsp; &nbsp; System.out.println&#40;getPetalsJmxClient&#40;&#41;.getAdminServiceClient&#40;&#41;.getSystemInfo&#40;&#41;&#41;;<br />
&nbsp; &nbsp; &#125;<br />
</td>        </tr></table><span class="postbody"><br />
So you can't get the version without starting the JMX  <img src="http://petals.ebmwebsourcing.com/forum/images/smiles/icon_sad.gif" alt="Sad" border="0" /></div>
        <br /><div class="gensmall"><br />
<br />
<br />
-------------------- m2f --------------------<br />
<br />
Read this forum topic online here:<br />
<a href="http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=207#207" target="_blank">http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=207#207</a><br />
<br />
-------------------- m2f --------------------</div>
        </body>
</html>