首页 技术 正文
技术 2022年11月23日
0 收藏 853 点赞 4,782 浏览 5240 个字

spring JMS在接收消息的时候总是报错
org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: Unexpected error occured
at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)
at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:534)
at com.tiantian.springintejms.service.impl.ProducerServiceImpl.sendMessage(ProducerServiceImpl.java:26)
at com.tiantian.springintejms.test.ProducerConsumerTest.testSend(ProducerConsumerTest.java:48)
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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: javax.jms.JMSException: Unexpected error occured
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1306)
at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1760)
at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:231)
at org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessageProducerSupport.java:241)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:592)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:569)
at org.springframework.jms.core.JmsTemplate$3.doInJms(JmsTemplate.java:536)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:466)
... 26 more
Caused by: java.io.IOException: Unexpected error occured
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:209)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NoSuchMethodError: org.slf4j.MDC.getCopyOfContextMap()Ljava/util/Map;
at org.apache.activemq.util.MDCHelper.getCopyOfContextMap(MDCHelper.java:30)
at org.apache.activemq.thread.PooledTaskRunner.(PooledTaskRunner.java:42)
at org.apache.activemq.thread.TaskRunnerFactory.createTaskRunner(TaskRunnerFactory.java:80)
at org.apache.activemq.ActiveMQSessionExecutor.wakeup(ActiveMQSessionExecutor.java:101)
at org.apache.activemq.ActiveMQSessionExecutor.execute(ActiveMQSessionExecutor.java:85)
at org.apache.activemq.ActiveMQSession.dispatch(ActiveMQSession.java:1535)
at org.apache.activemq.ActiveMQConnection$2.processMessageDispatch(ActiveMQConnection.java:1733)
at org.apache.activemq.command.MessageDispatch.visit(MessageDispatch.java:109)
at org.apache.activemq.ActiveMQConnection.onCommand(ActiveMQConnection.java:1714)
at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116)
at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69)
at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:227)
at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:220)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202)
... 1 more

解决方案一

你好,我是刚刚给你私信的那个,还加你QQ给你发消息了。

我也是跟你一样的配置的,运行后也遇到了同样的问题,经过仔细检查……。

关于这个问题,我已经找到答案了!

原因:我下载的ActiveMQ是apache-activemq-5.11.1版本的,这是目前最新的版本,它在解压后是分成32位和64位两个版本的,

我报的这个错,是因为我运行的是apache-activemq-5.11.1\bin\activemq.bat这个启动程序,而我的系统是win7 64位的,估计是存在兼容问题。

解决:进到apache-activemq-5.11.1\bin\win64目录下,运行这里的activemq.bat程序来启动ActiveMQ服务,就顺利的成功了!

如果你的系统是32位的,你就试下apache-activemq-5.11.1\bin\win32目录下activemq.bat,希望也能帮到你!

解决方案二

仔细检查自己的配置文件,发现自己的原因是配置文件中的URL配置错了。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,088
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,564
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,413
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,186
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,822
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,905