NutzCN Logo
问答 关于rabbitmq
发布于 1931天前 作者 呆呆的初行者 2666 次浏览 复制 上一个帖子 下一个帖子
标签:

按照文档上面的方式写了集成rabbitmq测试类,run as junit的时候总是报连接问题,unknown source,有谁测试成功过求分享经验。

22 回复

贴报错信息

而且源码里面就有testcase哦,可以参考一下

我就是按文档写了一个一模一样的,跑起来就是这个错

java.net.ConnectException: Connection refused: connect
	at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
	at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
	at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at com.rabbitmq.client.impl.SocketFrameHandlerFactory.create(SocketFrameHandlerFactory.java:50)
	at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:60)
	at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:99)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:911)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:870)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:828)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:966)
	at com.yunda.capp.common.rabbitmq.RabbitmqIocLoaderTest.testRabbitmqIocLoader(RabbitmqIocLoaderTest.java:42)
	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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
java.net.ConnectException: Connection refused: connect

rabbitmq就没启动??

启动了,cmd里面启动的,因为头一次弄这东西,是不是我安装的rabbitmq还要修改什么东西吗??

你本地的吗? rabbitmq.properties 贴出来看看

#rabbitmq
rabbitmq.host=127.0.0.1
rabbitmq.port=5672

telnet 一下 5672端口试试

无法打开到主机的连接。。。。。。

so, 木有启动

我在cmd里面start rabbitmq,都显示 请求的服务已启动,换了几个端口都是无法打开到主机的连接

start rabbitmq是什么意思?? 安装完默认就是启动的, 系统服务

https://www.rabbitmq.com/install-windows.html

Then just run the installer, rabbitmq-server-3.6.10.exe. It takes around 2 minutes, and will set RabbitMQ up and running as a service, with a default configuration.

刚刚重新安装了一次rabbitmq,然后跑testcase, 无压力通过

我也重新装了一次,还是不行,我的电脑有毒么。。。。。

也是最新版?

官网最新版欢迎你。。。

装了一个3.6.10,然而没有什么改变

系统服务里面是否有它?

系统服务里面有个RabbitMQ,状态正在运行

添加回复
请先登陆
回到顶部