Failed to start jmx connector: Cannot bind to URL[rmi://localhost:1099/jmxrmi]

来源:互联网 发布:淘宝高仿衣服店推荐 编辑:程序博客网 时间:2024/05/16 11:06

 INFO  ActiveMQ JMS Message Broker (localhost, ID:cnshawlt1129-1495-1316140863881-0:0) started
INFO  Connector vm://localhost Started
 WARN  Failed to start jmx connector: Cannot bind to URL [rmi://localhost:1099/jmxrmi]: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
 java.net.ConnectException: Connection refused: connect]

 

 

Xml代码 
1. <bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean"> 
2.   <property name="config" value="classpath:org/apache/activemq/xbean/activemq.xml" /> 
3.   <property name="start" value="true" /> 
4. </bean> 
5.  
6. <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" depends-on="broker"> 
7.   <property name="brokerURL" value="vm://localhost"/> 
8. </bean> 
   如果persistent是true,那么ActiveMQ会在当前目录下创建一个缺省值是activemq-data的目录用于持久化保存数据。需要注意的是,如果程序中启动了多个不同名字的VM broker,那么可能会有如下警告:Failed to start jmx connector: Cannot bind to URL [rmi://localhost:1099/jmxrmi]: javax.naming.NameAlreadyBoundException…可以通过在transportOptions中追加 broker.useJmx=false来禁用JMX来避免这个警告

2.2.2 TCP Transport
TCP transport 允许客户端通过TCP socket连接到远程的broker。以下是配置语法:
tcp://hostname:port?transportOptions
Transport Options的可选值如下:

Option NameDefault ValueDescriptionminmumWireFormatVersion0The minimum version wireformat that is allowedtracefalseCauses all commands that are sent over the transport to be loggeduseLocalHosttrueWhen true, it causes the local machines name to resolve to “localhost”.socketBufferSize64 * 1024Sets the socket buffer size in bytessoTimeout0sets the socket timeout in millisecondsconnectionTimeout30000A non-zero value specifies the connection timeout in milliseconds. A zero value means wait forever for the connection to be established. Negative values are ignored.wireFormatdefaultThe name of the WireFormat to usewireFormat.* All the properties with this prefix are used to configure the wireFormat. See Configuring Wire Formats for more information

例如:tcp://localhost:61616?trace=false

 

source:http://www.goldenbug.net/tag/java/