Hello Bruce,

  Even After making the changes in the Activemq.bat file as mentioned in


  your mail, I was not able to stop the Broker using the command
"Activemq-

  admin stop hostname"

  

  Starting the ActiveMQ after making the changes in the activemq.bat
file 

  gives me the following errors in the console : 

  

'SUNJMX' is not recognized as an internal or external command,operable
program or batch file.

'-Dcom.sun.management.jmxremote.authenticate' is not recognized as an
internal or external command, operable program or batch file.

'-Dcom.sun.management.jmxremote.ssl' is not recognized as an internal or
external command,operable program or batch file.

 

  What changes need to be done in order to make it work properly?

  Eagerly waiting for your reply. 

  NOTE: ActiveMQ.bat file is attached with this mail in the text format.

 

Thanks and Regards,

Nawaz Ahmed

Progress Software Development Pvt Ltd 

 

-----Original Message-----
From: Bruce Snyder [mailto:bruce.sny...@gmail.com] 
Sent: Saturday, May 30, 2009 12:16 AM
To: users@activemq.apache.org
Subject: Re: Activemq-admin stop does not work

 

On Fri, May 29, 2009 at 2:45 AM, Johannes Frank

<johannes.fr...@kisters.de> wrote:

> 

> Hello I'm trying to use "activemq-admin stop" to stop a running
activemq

> instance (it is running, I have the other console spitting out output
all

> the time). I'm using the standard activemq 5.2 I downloaded from you.

> However, as soon as I'm doing the stop command: the following
Exception

> jungle is generated:

 

You just need to edit the ActiveMQ startup script a bit so that JMX

authentication and SSL are disabled and a port number is specified.

Just make the following edits to lines 76-77 to the bin/activemq.bat

script:

 

if "%SUNJMX%" == "" set

SUNJMX=-Dcom.sun.management.jmxremote.port=1099

-Dcom.sun.management.jmxremote.authenticate=false

-Dcom.sun.management.jmxremote.ssl=false

REM set SUNJMX=-Dcom.sun.management.jmxremote

 

After making this quick change to the script, start up ActiveMQ again

and the 'activemq-admin stop' command should work properly.

 

Bruce

-- 

perl -e 'print
unpack("u30","D0G)u8...@4vyy9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"

);'

 

ActiveMQ in Action: http://bit.ly/2je6cQ

Blog: http://bruceblog.org/

Twitter: http://twitter.com/brucesnyder

@echo off

REM ------------------------------------------------------------------------
REM Licensed to the Apache Software Foundation (ASF) under one or more
REM contributor license agreements.  See the NOTICE file distributed with
REM this work for additional information regarding copyright ownership.
REM The ASF licenses this file to You under the Apache License, Version 2.0
REM (the "License"); you may not use this file except in compliance with
REM the License.  You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM ------------------------------------------------------------------------

if exist "%HOME%\activemqrc_pre.bat" call "%HOME%\activemqrc_pre.bat"

if "%OS%"=="Windows_NT" @setlocal

rem %~dp0 is expanded pathname of the current script under NT
set DEFAULT_ACTIVEMQ_HOME=%~dp0..

if "%ACTIVEMQ_HOME%"=="" set ACTIVEMQ_HOME=%DEFAULT_ACTIVEMQ_HOME%
set DEFAULT_ACTIVEMQ_HOME=

:doneStart
rem find ACTIVEMQ_HOME if it does not exist due to either an invalid value 
passed
rem by the user or the %0 problem on Windows 9x
if exist "%ACTIVEMQ_HOME%\README.txt" goto checkJava

rem check for activemq in Program Files on system drive
if not exist "%SystemDrive%\Program Files\activemq" goto checkSystemDrive
set ACTIVEMQ_HOME=%SystemDrive%\Program Files\activemq
goto checkJava

:checkSystemDrive
rem check for activemq in root directory of system drive
if not exist %SystemDrive%\activemq\README.txt goto checkCDrive
set ACTIVEMQ_HOME=%SystemDrive%\activemq
goto checkJava

:checkCDrive
rem check for activemq in C:\activemq for Win9X users
if not exist C:\activemq\README.txt goto noAntHome
set ACTIVEMQ_HOME=C:\activemq
goto checkJava

:noAntHome
echo ACTIVEMQ_HOME is set incorrectly or activemq could not be located. Please 
set ACTIVEMQ_HOME.
goto end

:checkJava
set _JAVACMD=%JAVACMD%

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
goto runAnt

:noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=java.exe
echo.
echo Warning: JAVA_HOME environment variable is not set.
echo.

:runAnt

if "%ACTIVEMQ_BASE%" == "" set ACTIVEMQ_BASE=%ACTIVEMQ_HOME%

if "%ACTIVEMQ_OPTS%" == "" set ACTIVEMQ_OPTS=-Xmx512M 
-Dorg.apache.activemq.UseDedicatedTaskRunner=true

if "%SUNJMX%" == "" set
SUNJMX=-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
REM set SUNJMX=-Dcom.sun.management.jmxremote


REM Uncomment to enable YourKit profiling
REM SET ACTIVEMQ_DEBUG_OPTS="-agentlib:yjpagent"

REM Uncomment to enable remote debugging
REM SET ACTIVEMQ_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE 
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

REM Setup ActiveMQ Classpath. Default is the conf directory.
set ACTIVEMQ_CLASSPATH=%ACTIVEMQ_BASE%/conf;%ACTIVEMQ_CLASSPATH%

"%_JAVACMD%" %SUNJMX% %ACTIVEMQ_DEBUG_OPTS% %ACTIVEMQ_OPTS% %SSL_OPTS% 
-Dactivemq.classpath="%ACTIVEMQ_CLASSPATH%" -Dactivemq.home="%ACTIVEMQ_HOME%" 
-Dactivemq.base="%ACTIVEMQ_BASE%" -jar "%ACTIVEMQ_HOME%/bin/run.jar" start %*

goto end


:end
set _JAVACMD=
if "%OS%"=="Windows_NT" @endlocal

:mainEnd
if exist "%HOME%\activemqrc_post.bat" call "%HOME%\activemqrc_post.bat"


Reply via email to