今天下載了activemq最新版本apache-activemq-5.15.2來玩玩,看著教程說的挺簡單的,不過等我解壓完畢雙擊activemq.bat文件啟動時候,彈出的命令窗口一閃而逝。。
最后去找到的解決辦法是自己打開命令窗口并且進入activemq的bin目錄,然后輸入activemq命令并且執(zhí)行,如下
D:\soft\apache-activemq-5.15.2\bin>activemq
不過并沒有啟動成功,也沒有報出錯誤,而是出現(xiàn)下面的一堆提示:
Usage: Main [--extdir <dir>] [task] [task-options] [task data]
Tasks:
browse - Display selected messages in a specified destination.
bstat - Performs a predefined query that displays useful statistics regarding the specified broker
consumer - Receives messages from the broker
create - Creates a runnable broker instance in the specified path.
decrypt - Decrypts given text
dstat - Performs a predefined query that displays useful tabular statistics regarding the specified destination type
encrypt - Encrypts given text
export - Exports a stopped brokers data files to an archive file
list - Lists all available brokers in the specified JMX context
producer - Sends messages to the broker
purge - Delete selected destination's messages that matches the message selector
query - Display selected broker component's attributes and statistics.
start - Creates and starts a broker using a configuration file, or a broker URI.
stop - Stops a running broker specified by the broker name.
Task Options (Options specific to each task):
--extdir <dir> - Add the jar files in the directory to the classpath.
--version - Display the version information.
-h,-?,--help - Display this help information. To display task specific help, use Main [task] -h,-?,--help
Task Data:
- Information needed by each specific task.
于是再去找解決方案,最后發(fā)現(xiàn)是要輸入 activemq start 命令的,如下:
D:\soft\apache-activemq-5.15.2\bin>activemq start
這次是開始啟動了,不過卻報出了端口已經(jīng)被占用的錯誤,最終沒有啟動成功,錯誤信息如下:
java.io.IOException: Failed to bind to server socket: stomp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 due to: java.net.BindException: Address already in use:
然后我把端口號改成別的,依然是報錯,沒辦法就繼續(xù)百度解決辦法,最后找到的結(jié)果說是因為啟動了 Internet Connection Sharing (ICS)服務(wù)的原因,我想起了之前買了一個tplink無線網(wǎng)卡用來做無線熱點的設(shè)置中確實有啟動 Internet Connection Sharing (ICS)服務(wù)的步驟,于是就把這個服務(wù)關(guān)閉了,然后再次執(zhí)行 activemq start 命令,終于啟動成功了,不過有點麻煩的是無線熱點就不能用了,除非重新啟動該服務(wù)。