ActiveMQ,master/slave模式.关闭master,slave自动重启后,访问报错

INFO | Using Persistence Adapter: JDBCPersistenceAdapter(org.apache.commons.dbcp.BasicDataSource@683d57c4)
INFO | Database adapter driver override recognized for : [oracle_jdbc_driver] - adapter: class org.apache.activemq.store.jdbc.adapter.OracleJDBCAdapter
INFO | Database lock driver override not found for : [oracle_jdbc_driver]. Will use default implementation.
INFO | Attempting to acquire the exclusive lock to become the Master broker
INFO | Becoming the master on dataSource: org.apache.commons.dbcp.BasicDataSource@683d57c4
INFO | ActiveMQ 5.5.0 JMS Message Broker (testBroker) is starting
INFO | For help or more information please see: http://activemq.apache.org/
INFO | JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
INFO | Listening for connections at: tcp://ck:20002
INFO | Connector openwire Started
INFO | ActiveMQ JMS Message Broker (testBroker, ID:ck-2430-1511311173619-0:1) started
INFO | jetty-7.1.6.v20100715
INFO | ActiveMQ WebConsole initialized.
INFO | Initializing Spring FrameworkServlet 'dispatcher'
INFO | ActiveMQ Console at http://0.0.0.0:10002/admin
INFO | Initializing Spring root WebApplicationContext
INFO | OSGi environment not detected.
INFO | Apache Camel 2.7.0 (CamelContext: camel) is starting
INFO | JMX enabled. Using ManagedManagementStrategy.
INFO | Found 5 packages with 16 @Converter classes to load
INFO | Loaded 152 type converters in 0.509 seconds
WARN | Broker localhost not started so using testBroker instead
INFO | Connector vm://localhost Started
INFO | Route: route1 started and consuming from: Endpoint[activemq://example.A]
INFO | Total 1 routes, of which 1 is started.
INFO | Apache Camel 2.7.0 (CamelContext: camel) started in 1.265 seconds
INFO | Camel Console at http://0.0.0.0:10002/camel
INFO | ActiveMQ Web Demos at http://0.0.0.0:10002/demo
INFO | RESTful file access application at http://0.0.0.0:10002/fileserver
INFO | Started SelectChannelConnector@0.0.0.0:10002
WARN | /admin/topics.jsp
javax.el.ELException: java.lang.reflect.UndeclaredThrowableException
at javax.el.BeanELResolver.getValue(BeanELResolver.java:298)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
at com.sun.el.parser.AstValue.getValue(AstValue.java:138)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:206)
at org.apache.jasper.runtime.PageContextImpl.evaluateExpression(PageContextImpl.java:1001)
at org.apache.jsp.topics_jsp._jspx_meth_c_out_1(org.apache.jsp.topics_jsp:218)
at org.apache.jsp.topics_jsp._jspx_meth_c_forEach_0(org.apache.jsp.topics_jsp:162)
at org.apache.jsp.topics_jsp._jspService(org.apache.jsp.topics_jsp:104)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:527)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1216)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
at org.apache.activemq.web.SessionFilter.doFilter(SessionFilter.java:45)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
at org.apache.activemq.web.filter.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:81)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:421)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:493)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:930)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:358)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:866)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:456)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
at org.eclipse.jetty.server.Server.handle(Server.java:351)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:594)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1042)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:549)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:211)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:424)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:506)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy68.getName(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:293)
... 47 more
Caused by: javax.management.InstanceNotFoundException: org.apache.activemq:BrokerName=testBroker,Type=Topic,Destination=ActiveMQ.Advisory.MasterBroker
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:643)
at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:678)
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:267)
... 53 more

1个回答

这是mq配置,三个节点除了端口都是一样的
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <value>file:${activemq.base}/conf/credentials.properties</value>
    </property>      
</bean>

<broker deleteAllMessagesOnStartup="false" xmlns="http://activemq.apache.org/schema/core" brokerName="testBroker" dataDirectory="${activemq.base}/data" >

    <persistenceAdapter>
          <jdbcPersistenceAdapter dataSource="#oracle-ds" createTablesOnStartup="true"/>
    </persistenceAdapter>

<!--    <persistenceAdapter>
        <kahaDB directory="${activemq.base}/data/kahadb"/>
    </persistenceAdapter>
     -->

    <transportConnectors>
        <transportConnector name="openwire" uri="tcp://0.0.0.0:20002"/>
    </transportConnectors>

</broker>

<import resource="jetty.xml"/>

<bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
      <property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"/>
      <property name="username" value="gx"/>
      <property name="password" value="gx"/>
      <property name="maxActive" value="200"/>
      <property name="poolPreparedStatements" value="true"/>
</bean>

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
急!ActiveMQ集群启动失败 No IOExceptionHandler registered, ignoring IO exception

ActiveMQ是最新5.15的版本,结合zookeeper搭的集群,搭建好第一次用时很正常,然后关机第二天重启以后发现启动失败了,控制台也打不开,大家能帮忙看看问题在哪么? ``` 2019-10-30 19:28:09,199 | INFO | No IOExceptionHandler registered, ignoring IO exception | org.apache.activemq.broker.BrokerService | LevelDB IOException handler. java.io.IOException: com/google/common/util/concurrent/internal/InternalFutureFailureAccess at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:40)[activemq-client-5.15.10.jar:5.15.10] at org.apache.activemq.leveldb.LevelDBClient.might_fail(LevelDBClient.scala:552)[activemq-leveldb-store-5.15.10.jar:5.15.10] at org.apache.activemq.leveldb.LevelDBClient.replay_init(LevelDBClient.scala:667)[activemq-leveldb-store-5.15.10.jar:5.15.10] at org.apache.activemq.leveldb.LevelDBClient.start(LevelDBClient.scala:558)[activemq-leveldb-store-5.15.10.jar:5.15.10] at org.apache.activemq.leveldb.DBManager.start(DBManager.scala:648)[activemq-leveldb-store-5.15.10.jar:5.15.10] at org.apache.activemq.leveldb.LevelDBStore.doStart(LevelDBStore.scala:312)[activemq-leveldb-store-5.15.10.jar:5.15.10] at org.apache.activemq.leveldb.replicated.MasterLevelDBStore.doStart(MasterLevelDBStore.scala:110)[activemq-leveldb-store-5.15.10.jar:5.15.10] at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55)[activemq-client-5.15.10.jar:5.15.10] at org.apache.activemq.leveldb.replicated.ElectingLevelDBStore$$anonfun$start_master$1.apply$mcV$sp(ElectingLevelDBStore.scala:230)[activemq-leveldb-store-5.15.10.jar:5.15.10] at org.fusesource.hawtdispatch.package$$anon$4.run(hawtdispatch.scala:330)[hawtdispatch-scala-2.11-1.22.jar:1.22] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_191] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_191] at java.lang.Thread.run(Thread.java:748)[:1.8.0_191] 2019-10-30 19:28:09,207 | INFO | Stopped LevelDB[/usr/local/activemq/apache-activemq-5.15.10/data/leveldb] | org.apache.activemq.leveldb.LevelDBStore | LevelDB IOException handler. ``` 查了网上的解决方案 一种是让删除lib文件夹下的一个jar包,但是我看了文件夹里面并没有 另一种让把配置文件xml里面的日志配置注释掉,我注释后再运行,日志内容如下: 2019-10-30 21:09:25,810 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@598067a5: startup date [Wed Oct 30 21:09:25 CST 2019]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main 2019-10-30 21:09:26,471 | INFO | Using Persistence Adapter: Replicated LevelDB[/usr/local/activemq/apache-activemq-5.15.10/data/leveldb, 211.67.17.205:2181,211.67.19.187:2181,211.67.16.224:2181//activemq/leveldb-stores] | org.apache.activemq.broker.BrokerService | main 2019-10-30 21:09:26,572 | INFO | Starting StateChangeDispatcher | org.apache.activemq.leveldb.replicated.groups.ZKClient | ZooKeeper state change dispatcher thread 2019-10-30 21:09:26,578 | INFO | Client environment:zookeeper.version=3.4.14-4c25d480e66aadd371de8bd2fd8da255ac140bcf, built on 03/06/2019 16:18 GMT | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,578 | INFO | Client environment:host.name=admin1 | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,578 | INFO | Client environment:java.version=1.8.0_191 | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,578 | INFO | Client environment:java.vendor=Oracle Corporation | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,578 | INFO | Client environment:java.home=/usr/java/jdk1.8.0_191/jre | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,578 | INFO | Client environment:java.class.path=/usr/local/activemq/apache-activemq-5.15.10/bin/activemq.jar | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,578 | INFO | Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,578 | INFO | Client environment:java.io.tmpdir=/usr/local/activemq/apache-activemq-5.15.10/tmp | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,578 | INFO | Client environment:java.compiler=<NA> | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,578 | INFO | Client environment:os.name=Linux | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,578 | INFO | Client environment:os.arch=amd64 | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,578 | INFO | Client environment:os.version=3.13.0-24-generic | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,578 | INFO | Client environment:user.name=admin1 | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,579 | INFO | Client environment:user.home=/home/admin1 | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,579 | INFO | Client environment:user.dir=/usr/local/activemq/zookeeper-3.4.10/bin | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,579 | INFO | Initiating client connection, connectString=211.67.17.205:2181,211.67.19.187:2181,211.67.16.224:2181 sessionTimeout=2000 watcher=org.apache.activemq.leveldb.replicated.groups.ZKClient@dc7df28 | org.apache.zookeeper.ZooKeeper | main 2019-10-30 21:09:26,591 | WARN | SASL configuration failed: javax.security.auth.login.LoginException: No JAAS configuration section named 'Client' was found in specified JAAS configuration file: '/usr/local/activemq/apache-activemq-5.15.10/conf/login.config'. Will continue connection to Zookeeper server without SASL authentication, if Zookeeper server allows it. | org.apache.zookeeper.ClientCnxn | main-SendThread(211.67.19.187:2181) 2019-10-30 21:09:26,592 | INFO | Opening socket connection to server 211.67.19.187/211.67.19.187:2181 | org.apache.zookeeper.ClientCnxn | main-SendThread(211.67.19.187:2181) 2019-10-30 21:09:26,593 | WARN | unprocessed event state: AuthFailed | org.apache.activemq.leveldb.replicated.groups.ZKClient | main-EventThread 2019-10-30 21:09:26,595 | INFO | Socket connection established to 211.67.19.187/211.67.19.187:2181, initiating session | org.apache.zookeeper.ClientCnxn | main-SendThread(211.67.19.187:2181) 2019-10-30 21:09:26,611 | INFO | Session establishment complete on server 211.67.19.187/211.67.19.187:2181, sessionid = 0x26e1bcd90df0005, negotiated timeout = 4000 | org.apache.zookeeper.ClientCnxn | main-SendThread(211.67.19.187:2181)

下载的apache-activemq-5.2.0-bin.zip这个压缩文件为什么不能解压

我从apache网站上下载的apache-activemq-5.2.0-bin.zip这个压缩文件为什么不能解压开?我下载apache-activemq-5.1.0-bin.zip以及apache-activemq-5.0.0-bin.zip这两个版本也都打不开,不知道为什么,在解压缩的时候提示:这个压缩文件格式未知或者数据已经被损坏!大家有没有遇到这个问题,是什么原因呢?大家知道的 请告诉小弟!非常谢谢谢!

ActiveMQ后台中多次出现一个警告 求原因和解决方案

![图片为我的接收消息的方法关闭session和结束连接的方式](https://img-ask.csdn.net/upload/201512/25/1451031420_952713.png)图片为我的接收消息的方法关闭session和结束连接的方式 在ActiveMQ的后台中多次出现 2015-12-25 15:55:39,271 | WARN | Transport Connection to: tcp://127.0.0.1:14720 failed: java.io.EOFException | org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ Transport: tcp:///127.0.0.1:14720@61616 2015-12-25 15:55:43,395 | WARN | Transport Connection to: tcp://127.0.0.1:14712 failed: java.net.SocketException: Connection reset | org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ Transport: tcp:///127.0.0.1:14712@61616 2015-12-25 15:56:16,830 | WARN | Transport Connection to: tcp://127.0.0.1:14725 failed: java.net.SocketException: Connection reset | org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ Transport: tcp:///127.0.0.1:14725@61616 这种警告,每次警告的端口都不一样 ,求帮我分析下原因和给个处理方案 MQ采用的是5.9版本 最近看才开始学习使用 ```

activeMQ创建连接抛空指针

javax.jms.JMSException: java.lang.NullPointerException at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1287) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1384) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:504) ~[activemq-all-5.4.2.jar:5.4.2] at com.catt.pub.net.jms.service.JMSCommon.connectio.createSessn(JMSCommon.java:192) ~[catt-pub-net.jar:na] at com.catt.pub.net.jms.service.Consumerion(Consumer.java:300) ~[catt-pub-net.jar:na] at com.catt.pub.net.jms.service.Consumer.createConsumerByTopic(Consumer.java:221) ~[catt-pub-net.jar:na] at com.catt.pub.net.jms.JMSUtils.getConsumer(JMSUtilJMSManageImpl.createConsumerss.java:137) ~[catt-pub-net.jar:na] at com.catt.zhwg.jms.services.collect.(JMSManageImpl.java:174) [JMSCollectModule-1.0.0.0-SNAPSHOT.jar:na] at com.catt.zhwg.jms.services.collect.JMSManageImpl.launch(JMSManageImpl.java:132) [JMSCollectModule-1.0.0.0-SNAPSHOT.jar:na] at com.catt.zhwg.jms.ManageThread.launch(ManageThread.java:106) [JMSCollectModule-1.0.0.0-SNAPSHOT.jar:na] at com.catt.zhwg.jms.utils.swing.Console.start(Console.java:172) [JMSCollectModule-1.0.0.0-SNAPSHOT.jar:na] at com.catt.zhwg.jms.utils.swing.Console.start(Console.java:153) [JMSCollectModule-1.0.0.0-SNAPSHOT.jar:na] at com.catt.zhwg.jms.utils.swing.SwingMain.main(SwingMain.java:50) [JMSCollectModule-1.0.0.0-SNAPSHOT.jar:na] java.lang.NullPointerException: null at com.huawei.imanager.nbi.activemq.security.CustomAuthenticate.addConnection(CustomAuthenticate.java:92) ~[na:na] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:91) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:715) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:79) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:292) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:150) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:229) ~[na:na] at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:222) ~[activemq-all-5.4.2.jar:5.4.2] at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:204) ~[activemq-all-5.4.2.jar:5.4.2] at java.lang.Thread.run(Unknown Source) ~[na:1.6.0_23]

配置好url之后,提示无法连接到url,试过更换为ip、本机的方式

javax.jms.JMSException: Could not connect to broker URL: tcp://192.168.1.137:61616. Reason: java.net.ConnectException: Connection refused: connect at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:36) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:358) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:303) at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:243) at com.hanthink.framework.client.jms.MessageTransceiver.initialize(MessageTransceiver.java:91) at com.hanthink.framework.client.jms.MessageTransceiver.<init>(MessageTransceiver.java:86) at com.hanthink.framework.client.jms.MessageSender.<init>(MessageSender.java:15) at jms.Sender.<init>(Sender.java:74) at jms.Sender.main(Sender.java:29) Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:501) at org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:464) at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55) at org.apache.activemq.transport.AbstractInactivityMonitor.start(AbstractInactivityMonitor.java:138) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58) at org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:338) ... 7 more

spring activemq 关闭时报错

javax.jms.JMSException: Peer (vm://localhost#3) disposed. at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62) at org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnection.java:1292) at org.apache.activemq.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1284) at org.apache.activemq.AdvisoryConsumer.dispose(AdvisoryConsumer.java:57) at org.apache.activemq.ActiveMQConnection.close(ActiveMQConnection.java:632) at org.springframework.jms.connection.SingleConnectionFactory.closeConnection(SingleConnectionFactory.java:456) at org.springframework.jms.connection.SingleConnectionFactory.resetConnection(SingleConnectionFactory.java:345) at org.springframework.jms.connection.CachingConnectionFactory.resetConnection(CachingConnectionFactory.java:205) at org.springframework.jms.connection.SingleConnectionFactory.destroy(SingleConnectionFactory.java:335) at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:258) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:540) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:516) at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:827) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:485) at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:921) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:809) Caused by: org.apache.activemq.transport.TransportDisposedIOException: Peer (vm://localhost#3) disposed. at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:89) at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68) at org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60) at org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnection.java:1290) ... 15 more 10:01:29 [org.apache.activemq.util.ThreadPoolUtils:136] [DEBUG] - Shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@5294755d[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] is shutdown: true and terminated: true took: 0.000 seconds. 10:01:29 [org.apache.activemq.util.ThreadPoolUtils:54] [DEBUG] - Forcing shutdown of ExecutorService: java.util.concurrent.ThreadPoolExecutor@6f902c71[Running, pool size = 2, active threads = 0, queued tasks = 0, completed tasks = 6] 10:01:29 [org.springframework.jms.connection.CachingConnectionFactory:463] [DEBUG] - Could not close shared JMS Connection javax.jms.JMSException: Peer (vm://localhost#3) disposed. at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62) at org.apache.activemq.ActiveMQConnection.doSyncSendPacket(ActiveMQConnection.java:1431) at org.apache.activemq.ActiveMQConnection.close(ActiveMQConnection.java:675) at org.springframework.jms.connection.SingleConnectionFactory.closeConnection(SingleConnectionFactory.java:456) at org.springframework.jms.connection.SingleConnectionFactory.resetConnection(SingleConnectionFactory.java:345) at org.springframework.jms.connection.CachingConnectionFactory.resetConnection(CachingConnectionFactory.java:205) at org.springframework.jms.connection.SingleConnectionFactory.destroy(SingleConnectionFactory.java:335) at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:258) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:540) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:516) at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:827) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:485) at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:921) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:809) Caused by: org.apache.activemq.transport.TransportDisposedIOException: Peer (vm://localhost#3) disposed. at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:89) at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68) at org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:81) at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:91) at org.apache.activemq.ActiveMQConnection.doSyncSendPacket(ActiveMQConnection.java:1418) ... 13 more 10:01:29 [org.springframework.beans.factory.support.DisposableBeanAdapter:323] [DEBUG] - Invoking destroy method 'close' on bean with name 'dataSource'

spring整合activemq时候出现的一个问题,望好心人解答

[code="java"]<amq:broker useJmx="false" persistent="true"> <amq:persistenceAdapter> <amq:amqPersistenceAdapter directory="G:/amq" /> <!-- 使用数据库持久化 --> <!--<amq:jdbcPersistenceAdapter dataSource="#mysql-ds" />--> </amq:persistenceAdapter> <amq:transportConnectors> <amq:transportConnector uri="tcp://localhost:61616" /> </amq:transportConnectors> </amq:broker>[/code] 以上这段是声明的一个broker,我现在想要修改activemq.xml里面的内容,但是由于是用内置的activemq而不是下载的activemq完整客户端,所以现在不知道要到哪儿去找xml文件。 网上搜了下,有如下的声明方法可以指定xml文件路径: [code="java"]<bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean"> <property name="config" value="classpath:activemq.xml" /> <property name="start" value="true" /> </bean>[/code] 但我想要的是用<amq:broker>这个标签,我翻看了amq的xsd,但是没有找到合适的标签。不知有没人知道,能够告诉我一下,万分感谢!!!

有没有熟悉ActiveMQ的大神!??困扰很久了,准备学习JMS,求帮助!

不知道是哪里配置不对,跟着网上码的一个例子,求大神指教! INFO | Successfully connected to tcp://localhost:61616 javax.jms.JMSSecurityException: User name [null] or password is invalid. at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:52) at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1398) at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1501) at org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:522) at com.whitewind.activemq.JMSProducer.main(JMSProducer.java:42) Caused by: java.lang.SecurityException: User name [null] or password is invalid. at org.apache.activemq.security.JaasAuthenticationBroker.authenticate(JaasAuthenticationBroker.java:89) at org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:68) at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:97) at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:102) at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:817) at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:77) at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139) at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:338) at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:188) at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50) at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113) at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:300) at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83) at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214) at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196) at java.lang.Thread.run(Unknown Source) Caused by: javax.security.auth.login.FailedLoginException: user name is null at org.apache.activemq.jaas.PropertiesLoginModule.login(PropertiesLoginModule.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at javax.security.auth.login.LoginContext.invoke(Unknown Source) at javax.security.auth.login.LoginContext.access$000(Unknown Source) at javax.security.auth.login.LoginContext$4.run(Unknown Source) at javax.security.auth.login.LoginContext$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.login.LoginContext.invokePriv(Unknown Source) at javax.security.auth.login.LoginContext.login(Unknown Source) at org.apache.activemq.security.JaasAuthenticationBroker.authenticate(JaasAuthenticationBroker.java:84) ... 15 more

activemq-web报错,activemq版本为5.9

**错误代码** java.lang.IllegalStateException: A filter or servlet of the current chain does not support asynchronous operations. at org.apache.catalina.connector.Request.startAsync(Request.java:1675) at org.apache.catalina.connector.Request.startAsync(Request.java:1668) at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1022) at org.eclipse.jetty.continuation.Servlet3Continuation.suspend(Servlet3Continuation.java:202) at org.apache.activemq.web.MessageListenerServlet.doMessages(MessageListenerServlet.java:349) at org.apache.activemq.web.MessageListenerServlet.doGet(MessageListenerServlet.java:250) at org.apache.activemq.web.AjaxServlet.doGet(AjaxServlet.java:47) at javax.servlet.http.HttpServlet.service(HttpServlet.java:624) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.eclipse.jetty.continuation.ContinuationFilter.doFilter(ContinuationFilter.java:137) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) ** 我的web.xml配置** <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>mqajax</display-name> <context-param> <description>Whether we should include an embedded broker or not</description> <param-name>org.apache.activemq.brokerURL</param-name> <param-value>tcp://127.0.0.1:61616</param-value> <!-- 这里可以写tcp://192.168.1.111:61616的形式连接其他服务器上的ActiveMQ服务器 --> </context-param> <servlet> <servlet-name>AjaxServlet</servlet-name> <servlet-class>org.apache.activemq.web.AjaxServlet</servlet-class> <load-on-startup>1</load-on-startup> <async-supported>true</async-supported> </servlet> <servlet> <servlet-name>MessageServlet</servlet-name> <servlet-class>org.apache.activemq.web.MessageServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>QueueBrowseServlet</servlet-name> <servlet-class>org.apache.activemq.web.QueueBrowseServlet</servlet-class> </servlet> <servlet> <servlet-name>PortfolioPublishServlet</servlet-name> <servlet-class>org.apache.activemq.web.PortfolioPublishServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>AjaxServlet</servlet-name> <url-pattern>/amq/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>MessageServlet</servlet-name> <url-pattern>/message/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>QueueBrowseServlet</servlet-name> <url-pattern>/queueBrowse/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>PortfolioPublishServlet</servlet-name> <url-pattern>/portfolioPublish</url-pattern> </servlet-mapping> <!-- 这种方式是在tomcat7版本以下运行,因为ajax+activemq需要servlet3.0的支持,而servlet3.0又只有在tomcat7中得到支持,所有加上jetty此包,就能在tomcat6运行了 --> <filter> <filter-name>session</filter-name> <filter-class>org.eclipse.jetty.continuation.ContinuationFilter</filter-class> </filter> <filter-mapping> <filter-name>session</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> **JS代码** <script type="text/javascript"> var amq = org.activemq.Amq; amq.init({ uri: 'amq', logging: true, timeout: 20 }); var myHandler = function(message){ $("#msgDiv").append(message); $("#msgDiv").append("<br>"); } amq.addListener("smeguangdong","topic://FirstTopic",myHandler); function send(){ var nickname = $("#nickname").val(); var content = $("#content").val(); var msg = nickname + " : " +content; //alert(msg); amq.sendMessage("topic://FirstTopic","<message>"+msg+"</message>"); } </script>

ActiveMQ提示重新连接出错

2016-03-29 21:52:03,136 | WARN | Transport Connection to: MQTTSocket_621347941 failed: java.io.IOException: Broker: localhost - Client: cy already connected from MQTTSocket_475507959 | org.apache.activemq.broker.TransportConnection.Transport | qtp1907161685-36 2016-03-29 21:55:19,990 | WARN | Failed to add Connection ID:iZ94bx4ng7iZ-58865-1459258343193-2:22 | org.apache.activemq.broker.TransportConnection | qtp1907161685-37 javax.jms.InvalidClientIDException: Broker: localhost - Client: cy already connected from MQTTSocket_475507959 at org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:255)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.broker.jmx.ManagedRegionBroker.addConnection(ManagedRegionBroker.java:231)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:97)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:92)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:97)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:97)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:97)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:87)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:97)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:102)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:809)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:79)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139)[activemq-client-5.11.3.jar:5.11.3] at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:334)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:188)[activemq-broker-5.11.3.jar:5.11.3] at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)[activemq-client-5.11.3.jar:5.11.3] at org.apache.activemq.transport.ws.jetty8.MQTTSocket.sendToActiveMQ(MQTTSocket.java:122)[activemq-http-5.11.3.jar:5.11.3] at org.apache.activemq.transport.mqtt.MQTTProtocolConverter.sendToActiveMQ(MQTTProtocolConverter.java:173)[activemq-mqtt-5.11.3.jar:5.11.3] at org.apache.activemq.transport.mqtt.MQTTProtocolConverter.onMQTTConnect(MQTTProtocolConverter.java:275)[activemq-mqtt-5.11.3.jar:5.11.3] at org.apache.activemq.transport.mqtt.MQTTProtocolConverter.onMQTTCommand(MQTTProtocolConverter.java:196)[activemq-mqtt-5.11.3.jar:5.11.3] at org.apache.activemq.transport.ws.jetty8.MQTTSocket.onMessage(MQTTSocket.java:62)[activemq-http-5.11.3.jar:5.11.3] at org.eclipse.jetty.websocket.WebSocketConnectionRFC6455$WSFrameHandler.onFrame(WebSocketConnectionRFC6455.java:878)[jetty-all-8.1.16.v20140903.jar:8.1.16.v20140903] at org.eclipse.jetty.websocket.WebSocketParserRFC6455.parseNext(WebSocketParserRFC6455.java:349)[jetty-all-8.1.16.v20140903.jar:8.1.16.v20140903] at org.eclipse.jetty.websocket.WebSocketConnectionRFC6455.handle(WebSocketConnectionRFC6455.java:225)[jetty-all-8.1.16.v20140903.jar:8.1.16.v20140903] at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)[jetty-all-8.1.16.v20140903.jar:8.1.16.v20140903] at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)[jetty-all-8.1.16.v20140903.jar:8.1.16.v20140903] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[jetty-all-8.1.16.v20140903.jar:8.1.16.v20140903] at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[jetty-all-8.1.16.v20140903.jar:8.1.16.v20140903] at java.lang.Thread.run(Thread.java:745)[:1.7.0_76] 2016-03-29 21:55:19,993 | WARN | Transport Connection to: MQTTSoc 大家帮我看看,activemq同一个clientID=cy,提示已经连接了,不能再连接。如何解决?

如何激活ActiveMQ持久性以抵抗重启?

<div class="post-text" itemprop="text"> <p>I do get ActiveMQ supports data persistence (<a href="http://activemq.apache.org/persistence.html" rel="nofollow noreferrer">http://activemq.apache.org/persistence.html</a>), but i cannot understand how to make it work, the result is when i restart ActiveMQ all the messages disappear, while queues and topics remain. </p> <p>I've read about to enable persistence on a database but i want to keep data on the filesystem since my system is facing database perfomance issues.</p> <p>This is my activemq.xml</p> <pre><code>&lt;!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --&gt; &lt;!-- START SNIPPET: example --&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"&gt; &lt;!-- Allows us to use system properties as variables in this configuration file --&gt; &lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt; &lt;property name="locations"&gt; &lt;value&gt;file:${activemq.conf}/credentials.properties&lt;/value&gt; &lt;/property&gt; &lt;/bean&gt; &lt;!-- Allows accessing the server log --&gt; &lt;bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery" lazy-init="false" scope="singleton" init-method="start" destroy-method="stop"&gt; &lt;/bean&gt; &lt;!-- The &lt;broker&gt; element is used to configure the ActiveMQ broker. --&gt; &lt;broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}"&gt; &lt;destinationPolicy&gt; &lt;policyMap&gt; &lt;policyEntries&gt; &lt;policyEntry topic="&gt;" &gt; &lt;!-- The constantPendingMessageLimitStrategy is used to prevent slow topic consumers to block producers and affect other consumers by limiting the number of messages that are retained For more information, see: http://activemq.apache.org/slow-consumer-handling.html --&gt; &lt;pendingMessageLimitStrategy&gt; &lt;constantPendingMessageLimitStrategy limit="1000"/&gt; &lt;/pendingMessageLimitStrategy&gt; &lt;/policyEntry&gt; &lt;/policyEntries&gt; &lt;/policyMap&gt; &lt;/destinationPolicy&gt; &lt;!-- The managementContext is used to configure how ActiveMQ is exposed in JMX. By default, ActiveMQ uses the MBean server that is started by the JVM. For more information, see: http://activemq.apache.org/jmx.html --&gt; &lt;managementContext&gt; &lt;managementContext createConnector="false"/&gt; &lt;/managementContext&gt; &lt;!-- Configure message persistence for the broker. The default persistence mechanism is the KahaDB store (identified by the kahaDB tag). For more information, see: http://activemq.apache.org/persistence.html --&gt; &lt;persistenceAdapter&gt; &lt;kahaDB directory="${activemq.data}/kahadb"/&gt; &lt;/persistenceAdapter&gt; &lt;!-- The systemUsage controls the maximum amount of space the broker will use before disabling caching and/or slowing down producers. For more information, see: http://activemq.apache.org/producer-flow-control.html --&gt; &lt;systemUsage&gt; &lt;systemUsage&gt; &lt;memoryUsage&gt; &lt;memoryUsage percentOfJvmHeap="70" /&gt; &lt;/memoryUsage&gt; &lt;storeUsage&gt; &lt;storeUsage limit="100 gb"/&gt; &lt;/storeUsage&gt; &lt;tempUsage&gt; &lt;tempUsage limit="50 gb"/&gt; &lt;/tempUsage&gt; &lt;/systemUsage&gt; &lt;/systemUsage&gt; &lt;!-- The transport connectors expose ActiveMQ over a given protocol to clients and other brokers. For more information, see: http://activemq.apache.org/configuring-transports.html --&gt; &lt;transportConnectors&gt; &lt;!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --&gt; &lt;transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt; &lt;transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt; &lt;transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt; &lt;transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt; &lt;transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt; &lt;/transportConnectors&gt; &lt;!-- destroy the spring context on shutdown to stop jetty --&gt; &lt;shutdownHooks&gt; &lt;bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" /&gt; &lt;/shutdownHooks&gt; &lt;/broker&gt; &lt;!-- Enable web consoles, REST and Ajax APIs and demos The web consoles requires by default login, you can disable this in the jetty.xml file Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details --&gt; &lt;import resource="jetty.xml"/&gt; </code></pre> <p> </p> </div>

Linux 下 activeMQ 读取远程activemq.xml

项目要求 Linux下部署ActiveMQ,原本ActiveMQ读取的是/conf下的activemq.xml, 现在要求好多机器读取一个机器上的xml文件,想修改ActiveMQ读取其他机器上生成的activemq.xml文件,不知道linux下ActiveMQ是在哪里读取的?如何修改?有人知道吗?

使用activeMQ监听,调用mapper时为null怎么解决,请大神帮忙看看

**spring文件配置如下:** <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd http://www.springframework.org/schema/jms"> <context:annotation-config/> <context:component-scan base-package="com.lizx" /> <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/> <!-- 定义事务管理器 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <!-- 定义事务策略 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <!--所有以query开头的方法都是只读的 --> <tx:method name="query*" read-only="true" /> <tx:method name="get*" read-only="true" /> <!--其他方法使用默认事务策略 --> <tx:method name="delete*" propagation="REQUIRED" read-only="false"/> <tx:method name="edit*" propagation="REQUIRED" read-only="false"/> <tx:method name="add*" propagation="REQUIRED" read-only="false"/> </tx:attributes> </tx:advice> <aop:config> <!--pointcut元素定义一个切入点,execution中的第一个星号 用以匹配方法的返回类型, 这里星号表明匹配所有返回类型。 com.bw.service.*.*(..)表明匹配com.bw.service包下的所有类的所有 方法 --> <aop:pointcut id="myPointcut" expression="execution(* com.lizx.app.service.*.*(..))" /> <!--将定义好的事务处理策略应用到上述的切入点 --> <aop:advisor advice-ref="txAdvice" pointcut-ref="myPointcut" /> </aop:config> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource"></property> <!-- 加载mybatis.cfg.xml文件 --> <property name="configLocation" value="classpath:conf/SqlMapConfig.xml"></property> <!-- 自动扫描需要定义类别名的包,将包内的JAVA类的类名作为类别名 --> <property name="typeAliasesPackage" value="com.lizx.app"></property> </bean> <!-- 自动扫描所有的Mapper接口与文件 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.lizx.app.mapper"></property> </bean> <import resource="classpath*:conf/spring-ActiveMQ.xml" /> </beans> ------------------------------------ **activemq配置如下:** <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-4.1.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.12.1.xsd"> <mvc:annotation-driven /> <amq:connectionFactory id="amqConnectionFactory" brokerURL="tcp://127.0.0.1:61616" userName="admin" password="admin" /> <!-- 配置JMS连接工长 --> <bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory"> <constructor-arg ref="amqConnectionFactory" /> <property name="sessionCacheSize" value="100" /> </bean> <!-- 定义消息队列(Queue) --> <bean id="demoQueueDestination" class="org.apache.activemq.command.ActiveMQQueue"> <!-- 设置消息队列的名字 --> <constructor-arg> <value>Jaycekon</value> </constructor-arg> </bean> <!-- 配置JMS模板(Queue),Spring提供的JMS工具类,它发送、接收消息。 --> <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"> <property name="connectionFactory" ref="connectionFactory" /> <property name="defaultDestination" ref="demoQueueDestination" /> <property name="receiveTimeout" value="10000" /> <!-- true是topic,false是queue,默认是false,此处显示写出false --> <property name="pubSubDomain" value="false" /> </bean> <!-- 配置消息队列监听者(Queue) --> <bean id="queueMessageListener" class="com.lizx.app.MQListener" /> <bean id="queueListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <property name="connectionFactory" ref="connectionFactory" /> <property name="destination" ref="demoQueueDestination" /> <property name="messageListener" ref="queueMessageListener" /> </bean> </beans> ------------------------------------ **在监听中使用为null时的情况** ![图片说明](https://img-ask.csdn.net/upload/201802/25/1519561067_682041.png) **在其它地方调用,不为null时的情况:** ![图片说明](https://img-ask.csdn.net/upload/201802/25/1519561131_923727.png)

activemq从节点获取不了主节点的队列内容?

activemq以jdbc持久化master+slave的方式配置(没有用zookeeper),启动时已看到链接成功 ``` 2019-05-14 11:15:28,562 | INFO | Network connection between vm://slave#0 and tcp://0.0.0.0:61616 (master) has been established. | org.apache.activemq.network.DemandForwardingBridgeSupport | triggerStartAsyncNetworkBridgeCreation: remoteBroker=unconnected, localBroker= vm://slave#0 ``` 链接url,因为开发电脑虚拟出了两台虚机,所以都是61616端口,下面的ip实际上是不一样的 ``` private String brokerURL = "failover://(tcp://0.0.0.0:61616,tcp://0.0.0.0:61616)"; ``` 两个节点启动完成后,程序发送信息 ``` public static void main(String[] args) { TestContro send = new TestContro(); send.start(); } // public static void main(String[] args) { // TestContro cons = new TestContro(); // cons.consum(); // } // public void start(){ try { //根据用户名,密码,url创建一个连接工厂 factory = new ActiveMQConnectionFactory(userName, password, brokerURL); //从工厂中获取一个连接 connection = factory.createConnection(); //测试过这个步骤不写也是可以的,但是网上的各个文档都写了 connection.start(); //创建一个session //第一个参数:是否支持事务,如果为true,则会忽略第二个参数,被jms服务器设置为SESSION_TRANSACTED //第二个参数为false时,paramB的值可为Session.AUTO_ACKNOWLEDGE,Session.CLIENT_ACKNOWLEDGE,DUPS_OK_ACKNOWLEDGE其中一个。 //Session.AUTO_ACKNOWLEDGE为自动确认,客户端发送和接收消息不需要做额外的工作。哪怕是接收端发生异常,也会被当作正常发送成功。 //Session.CLIENT_ACKNOWLEDGE为客户端确认。客户端接收到消息后,必须调用javax.jms.Message的acknowledge方法。jms服务器才会当作发送成功,并删除消息。 //DUPS_OK_ACKNOWLEDGE允许副本的确认模式。一旦接收方应用程序的方法调用从处理消息处返回,会话对象就会确认消息的接收;而且允许重复确认。 session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE); //创建一个到达的目的地,其实想一下就知道了,activemq不可能同时只能跑一个队列吧,这里就是连接了一个名为"text-msg"的队列,这个会话将会到这个队列,当然,如果这个队列不存在,将会被创建 destination = session.createQueue("test"); //从session中,获取一个消息生产者 producer = session.createProducer(destination); //设置生产者的模式,有两种可选 //DeliveryMode.PERSISTENT 当activemq关闭的时候,队列数据将会被保存 //DeliveryMode.NON_PERSISTENT 当activemq关闭的时候,队列里面的数据将会被清空 producer.setDeliveryMode(DeliveryMode.PERSISTENT); //创建一条消息,当然,消息的类型有很多,如文字,字节,对象等,可以通过session.create..方法来创建出来 TextMessage textMsg = session.createTextMessage("呵呵"); for(int i = 0 ; i < 3 ; i ++){ //发送一条消息 producer.send(textMsg); } System.out.println("发送消息成功"); //即便生产者的对象关闭了,程序还在运行哦 producer.close(); } catch (JMSException e) { e.printStackTrace(); } } ``` 在主节点控制台能看到待消费数量增加,但是从节点看不到数量变化,而且杀死主节点后,程序自动连接从节点发送,mq报数据库主键冲突 配置文件 ``` <networkConnectors> <networkConnector uri="static:(tcp://x.x.x.x:61616)" duplex="false"/> </networkConnectors> ``` 求大神帮忙看看。

activemq的集群负载均衡

ZooKeeper + LevelDB + Static discovery 做activemq的集群负载均衡 在activemq.xml中已经添加了如下的配置 集群a: ``` <networkConnectors> <networkConnector uri="static:(tcp://10.1.60.32:53531,tcp://10.1.60.32:53532,tcp://10.1.60.32:53533)" duplex="false"/> </networkConnectors> ``` 集群b: ``` <networkConnectors> <networkConnector uri="static:(tcp://10.1.60.41:51511,tcp://10.1.60.42:51512,tcp://10.1.60.43:51513)" duplex="false"/> </networkConnectors> ``` 如上是我的配置,我是2个集群各3台activemq,每个单点都做了另外一个集群的networkConnnetor配置,activemq实例启动都是正常的,但是启动后无法通过桥接互相消费消息,报如下的错误,2边的日志中都有: A端的日志报: 2016-05-13 17:24:17,238 | WARN | Failed to add Connection Broker->Broker2-48906-1463129863611-233:1 | org.apache.activemq.broker.TransportConnection | triggerStartAsyncNetworkBridgeCreation: remoteBroker=tcp:///10.1.60.32:53531@51183, localBroker= vm://Broker#346 java.lang.SecurityException: User name [null] or password is invalid. at b端的日志报: 2016-05-13 17:25:25,671 | WARN | Failed to add Connection Broker2->Broker-50573-1463130022715-221:1 | org.apache.activemq.broker.TransportConnection | triggerStartAsyncNetworkBridgeCreation: remoteBroker=tcp:///10.1.60.43:51513@37179, localBroker= vm://Broker2#328 java.lang.SecurityException: User name [null] or password is invalid. at 百度了很久都没有类似的问题得到解决,不知道有没有谁碰到过此类问题?

activemq上使用stomp出现的问题

http://www.oschina.net/translate/easy-messaging-with-stomp-over-websockets-using-activemq-and-hornetq?cmp 我是按照这个教程去做的。。但是浏览器输出的是 WebSocket connection to 'ws://127.0.0.1:61614/stomp' failed: Error during WebSocket handshake: 'Sec-WebSocket-Protocol' header value 'stomp' in response does not match any of sent values

【防火墙已关闭】帮看下JMX本地Main方法连接取Broker报错

# **帮我看下JMX本地Main方法连接取Broker报错 # (No broker is found at any of the 1 configured urls)** **JConsole通过jmxrmi连接 service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi本地正常** ![JConsole本地连接截图](https://img-ask.csdn.net/upload/201603/11/1457682430_510156.png) **activemq.xml配置** ``` <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- START SNIPPET: example --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> <!-- Allows us to use system properties as variables in this configuration file --> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <value>file:${activemq.conf}/credentials.properties</value> </property> </bean> <!-- Allows accessing the server log --> <bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery" lazy-init="false" scope="singleton" init-method="start" destroy-method="stop"> </bean> <!-- The <broker> element is used to configure the ActiveMQ broker. --> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="wwwwww" dataDirectory="${activemq.data}" useJmx="true"> <destinationPolicy> <policyMap> <policyEntries> <policyEntry topic=">" > <!-- The constantPendingMessageLimitStrategy is used to prevent slow topic consumers to block producers and affect other consumers by limiting the number of messages that are retained For more information, see: http://activemq.apache.org/slow-consumer-handling.html --> <pendingMessageLimitStrategy> <constantPendingMessageLimitStrategy limit="1000"/> </pendingMessageLimitStrategy> </policyEntry> </policyEntries> </policyMap> </destinationPolicy> <!-- The managementContext is used to configure how ActiveMQ is exposed in JMX. By default, ActiveMQ uses the MBean server that is started by the JVM. For more information, see: http://activemq.apache.org/jmx.html --> <managementContext> <managementContext createConnector="true"/> </managementContext> <!-- Configure message persistence for the broker. The default persistence mechanism is the KahaDB store (identified by the kahaDB tag). For more information, see: http://activemq.apache.org/persistence.html <kahaDB directory="${activemq.data}/kahadb"/> --> <persistenceAdapter> <kahaDB directory="${activemq.data}/kahadb"/> <!--<jdbcPersistenceAdapter dataDirectory="${activemq.data}" dataSource="#derby-ds"/> <jdbcPersistenceAdapter dataSource="#mysql-ds" createTablesOnStartup="true" />--> </persistenceAdapter> <!-- The systemUsage controls the maximum amount of space the broker will use before disabling caching and/or slowing down producers. For more information, see: http://activemq.apache.org/producer-flow-control.html --> <systemUsage> <systemUsage> <memoryUsage> <memoryUsage percentOfJvmHeap="70" /> </memoryUsage> <storeUsage> <storeUsage limit="100 gb"/> </storeUsage> <tempUsage> <tempUsage limit="50 gb"/> </tempUsage> </systemUsage> </systemUsage> <!-- The transport connectors expose ActiveMQ over a given protocol to clients and other brokers. For more information, see: http://activemq.apache.org/configuring-transports.html --> <transportConnectors> <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --> <transportConnector name="openwire" uri="tcp://127.0.0.1:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/> <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/> <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/> <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/> <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/> </transportConnectors> <!-- destroy the spring context on shutdown to stop jetty --> <shutdownHooks> <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" /> </shutdownHooks> <plugins> <simpleAuthenticationPlugin> <users> <authenticationUser username="user" password="user123" groups="users" /> </users> </simpleAuthenticationPlugin> </plugins> </broker> <!--<bean id="derby-ds" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://10.0.10.66/activemq?relaxAutoCommit=true"/> <property name="username" value="root"/> <property name="password" value="123456"/> <property name="maxTotal" value="200"/> <property name="poolPreparedStatements" value="true"/> </bean> Enable web consoles, REST and Ajax APIs and demos The web consoles requires by default login, you can disable this in the jetty.xml file Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details --> <import resource="jetty.xml"/> </beans> <!-- END SNIPPET: example --> ``` **main方法报错 -----No broker is found at any of the 1 configured urls** ``` String ip = "127.0.0.1"; RemoteJMXBrokerFacade createConnector = new RemoteJMXBrokerFacade(); System.out.println("service:jmx:rmi:///jndi/rmi://"+ip+":1099/jmxrmi"); System.setProperty("webconsole.jmx.url", "service:jmx:rmi:///jndi/rmi://"+ip+":1099/jmxrmi"); System.setProperty("webconsole.jmx.user","admin"); System.setProperty("webconsole.jmx.password","activemq"); SystemPropertiesConfiguration configuration = new SystemPropertiesConfiguration(); createConnector.setConfiguration(configuration); System.out.println(configuration); System.out.println(ip+"执行开始-------"+configuration.getJmxUser()); try { BrokerViewMBean brokerAdmin = createConnector.getBrokerAdmin(); String brokerName =brokerAdmin.getBrokerName(); System.out.println("BrokerName ="+brokerName ); long messages =brokerAdmin.getTotalMessageCount(); System.out.println("messages ="+messages ); long consumerCount=brokerAdmin.getTotalConsumerCount(); System.out.println("consumerCount ="+consumerCount ); long dequeueCount=brokerAdmin.getTotalDequeueCount(); System.out.println("dequeueCount ="+dequeueCount ); long enqueueCount=brokerAdmin.getTotalEnqueueCount(); System.out.println("enqueueCount ="+enqueueCount ); System.out.println(brokerAdmin.getBrokerName()); //获取Topic相关的ObjectName ObjectName[] topicList=brokerAdmin.getTopics(); System.out.println("topic ="+topicList.length); //获取Queue相关的ObjectName ObjectName[] queueList=brokerAdmin.getQueues(); System.out.println("queue ="+queueList.length); //根据ObjectName创建相关的JMX对象获取相关的信息。 } catch (Exception e) { e.printStackTrace(); } System.out.println(ip+"执行结束-------"); } ``` **Console 信息** ``` service:jmx:rmi:///jndi/rmi://127.0.0.1:1099/jmxrmi org.apache.activemq.web.config.SystemPropertiesConfiguration@4fccd51b 127.0.0.1执行开始-------admin 15:34:03.993 [main] DEBUG o.a.a.web.RemoteJMXBrokerFacade - Creating a new JMX-Connection to the broker 15:34:04.017 [main] DEBUG org.eclipse.jetty.util.log - Logging to Logger[org.eclipse.jetty.util.log] via org.eclipse.jetty.util.log.Slf4jLog 15:34:04.022 [main] INFO org.eclipse.jetty.util.log - Logging initialized @283ms 15:34:04.023 [main] DEBUG jndi - InitialContextFactory.getInitialContext() 15:34:04.027 [main] DEBUG jndi - supportDeepBinding=false 15:34:04.027 [main] DEBUG jndi - Created initial context delegate for local namespace:org.eclipse.jetty.jndi.local.localContextRoot@233c0b17 java.lang.IllegalStateException: No broker is found at any of the 1 configured urls at org.apache.activemq.web.RemoteJMXBrokerFacade.createConnection(RemoteJMXBrokerFacade.java:168) at org.apache.activemq.web.RemoteJMXBrokerFacade.getMBeanServerConnection(RemoteJMXBrokerFacade.java:114) at org.apache.activemq.web.RemoteJMXBrokerFacade.getBrokerAdmin(RemoteJMXBrokerFacade.java:88) at com.generateid.ActiveMQJMX.main(ActiveMQJMX.java:45) 127.0.0.1执行结束------- ```

求大神指教啊,linux看不出那到底哪里出问题了。。程序死了

#0 0x47f23c7c in _int_malloc () from /lib/libc.so.6 #1 0x47f25fb7 in malloc () from /lib/libc.so.6 #2 0x48729af7 in operator new(unsigned int) () from /usr/lib/libstdc++.so.6 #3 0x4870513b in std::string::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char> const&) () from /usr/lib/libstdc++.so.6 #4 0x48705cd8 in std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned int) () from /usr/lib/libstdc++.so.6 #5 0x48706888 in std::string::reserve(unsigned int) () from /usr/lib/libstdc++.so.6 #6 0x486ff543 in std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::overflow(int) () from /usr/lib/libstdc++.so.6 #7 0x48704311 in std::basic_streambuf<char, std::char_traits<char> >::xsputn(char const*, int) () from /usr/lib/libstdc++.so.6 #8 0x486f1fcd in std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_int<unsigned long>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, unsigned long) const () from /usr/lib/libstdc++.so.6 #9 0x486f22b0 in std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, unsigned long) const () from /usr/lib/libstdc++.so.6 #10 0x486f926d in std::ostream::operator<<(unsigned long) () from /usr/lib/libstdc++.so.6 #11 0xb7fc6c86 in log4cplus::thread::getCurrentThreadName () at src/threads.cxx:107 #12 0xb7fa7cb6 in getThread (this=<optimized out>) at ./include/log4cplus/spi/loggingevent.h:155 #13 log4cplus::spi::InternalLoggingEvent::gatherThreadSpecificData (this=0x82037b0) at src/loggingevent.cxx:251 #14 0xb7fba41f in log4cplus::thread::Queue::put_event (this=0x807da88, ev=...) at src/queue.cxx:56 #15 0xb7f85d98 in log4cplus::AsyncAppender::append (this=0x807c848, ev=...) at src/asyncappender.cxx:171 #16 0xb7f82df5 in log4cplus::Appender::doAppend (this=0x807c848, event=...) at src/appender.cxx:287 #17 0xb7f7fe49 in log4cplus::helpers::AppenderAttachableImpl::appendLoopOnAppenders (this=0x806c178, event=...) at src/appenderattachableimpl.cxx:164 #18 0xb7fa7556 in log4cplus::spi::LoggerImpl::callAppenders (this=0x806c178, event=...) at src/loggerimpl.cxx:60 #19 0xb7fa71d8 in log4cplus::spi::LoggerImpl::forcedLog (this=0x806c178, ev=...) at src/loggerimpl.cxx:179 #20 0xb7fa670b in log4cplus::Logger::forcedLog (this=0xb7fe1c6c, ev=...) at src/logger.cxx:272 #21 0xb7faae46 in log4cplus::detail::macro_forced_log (logger=..., log_level=20000, msg=..., filename=0xaf5d15d4 "MessageMq.cpp", line=111, func=0x806582c "OnMessageReciveTradeMq", servname=0x8065603 "mpay_third", chainid=0x8065602 "") at src/loggingmacros.cxx:96 #22 0xb7faea63 in MyLogger_log (LogLevel=LL_INFO, LogInfo=0xaf5d1747 "0000000000", pServiceName=0x8065603 "mpay_third", pInvokedChainID=0x8065602 "", pFileName=0x80655c8 "/mnt/hgfs/MPAY\344\270\211\346\234\237/service/mpay_third/src/MessageMq.cpp", LineNum=111, pFunName=0x806582c "OnMessageReciveTradeMq") at src/mylogger.cxx:74 #23 0x0805a8d0 in OnMessageReciveTradeMq (pRecvMsg=0xaf5d7048) at /mnt/hgfs/MPAY涓../service/mpay_third/src/MessageMq.cpp:111 #24 0xb7029273 in ProducterAndConsumer::onMessage (this=0x81f7f98, message=0x82032a8) at /mnt/hgfs/MPAY涓../public/common/src/producter-and-consumer.cpp:262 #25 0xb78f9190 in activemq::core::kernels::ActiveMQConsumerKernel::dispatch (this=0xaf60ea28, dispatch=...) at activemq/core/kernels/ActiveMQConsumerKernel.cpp:1535 #26 0xb78a1b8a in activemq::core::ActiveMQSessionExecutor::dispatch (this=0xaf60db18, dispatch=...) at activemq/core/ActiveMQSessionExecutor.cpp:156 #27 0xb78a20f0 in activemq::core::ActiveMQSessionExecutor::iterate (this=0xaf60db18) at activemq/core/ActiveMQSessionExecutor.cpp:181 #28 0xb79f9f97 in activemq::threads::DedicatedTaskRunner::run (this=0xaf60f468) at activemq/threads/DedicatedTaskRunner.cpp:141 #29 0xb7be30fa in decaf::lang::Thread::run (this=0xaf60f570) at decaf/lang/Thread.cpp:141 #30 0xb7ba5407 in (anonymous namespace)::runCallback (arg=0xaf60f7a8) at decaf/internal/util/concurrent/Threading.cpp:266 #31 0xb7ba5c5b in (anonymous namespace)::threadEntryMethod (arg=0xaf60f7a8) at decaf/internal/util/concurrent/Threading.cpp:254 #32 0x48062852 in start_thread () from /lib/libpthread.so.0 #33 0x47f8c84e in clone () from /lib/libc.so.6 Backtrace stopped: Not enough registers or memory available to unwind further

jasper.JasperException: An exception occurred processing JSP page /analysis.jsp at line 113

org.apache.jasper.JasperException: An exception occurred processing JSP page /analysis.jsp at line 113 110: </div> 111: <div id="collapse1" class="panel-collapse collapse in"> 112: <div class="panel-body"> 113: ${sq.SmaInContent} 114: </div> 115: </div> 116: </div> 这个我想我知道问题,这个值${sq.SmaInContent},肯定有值得,可以在控制台输出,有取到,用的mysql数据库,里面的这个对应字段存的是text类型,然后实体类对应的String类型,yong c标签页面输出的时候报这个错,怎么解决呀?求路过的各位大神给个解决方法

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

点沙成金:英特尔芯片制造全过程揭密

“亚马逊丛林里的蝴蝶扇动几下翅膀就可能引起两周后美国德州的一次飓风……” 这句人人皆知的话最初用来描述非线性系统中微小参数的变化所引起的系统极大变化。 而在更长的时间尺度内,我们所生活的这个世界就是这样一个异常复杂的非线性系统…… 水泥、穹顶、透视——关于时间与技艺的蝴蝶效应 公元前3000年,古埃及人将尼罗河中挖出的泥浆与纳特龙盐湖中的矿物盐混合,再掺入煅烧石灰石制成的石灰,由此得来了人...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

C++11:一些微小的变化(新的数据类型、template表达式内的空格、nullptr、std::nullptr_t)

本文介绍一些C++的两个新特性,它们虽然微小,但对你的编程十分重要 一、Template表达式内的空格 C++11标准之前建议在“在两个template表达式的闭符之间放一个空格”的要求已经过时了 例如: vector&lt;list&lt;int&gt; &gt;; //C++11之前 vector&lt;list&lt;int&gt;&gt;; //C++11 二、nullptr ...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

深入剖析Springboot启动原理的底层源码,再也不怕面试官问了!

大家现在应该都对Springboot很熟悉,但是你对他的启动原理了解吗?

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

【阿里P6面经】二本,curd两年,疯狂复习,拿下阿里offer

二本的读者,在老东家不断学习,最后逆袭

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

微软为一人收购一公司?破解索尼程序、写黑客小说,看他彪悍的程序人生!...

作者 | 伍杏玲出品 | CSDN(ID:CSDNnews)格子衬衫、常掉发、双肩包、修电脑、加班多……这些似乎成了大众给程序员的固定标签。近几年流行的“跨界风”开始刷新人们对程序员的...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

我说我懂多线程,面试官立马给我发了offer

不小心拿了几个offer,有点烦

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

立即提问
相关内容推荐