org.springframework.amqp.AmqpConnectException

java.net.ConnectException: Connection refused

Samebug tips9

Check if your MongoDB is available.


host port isnt set

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web21

  • java.net.ConnectException: Connection refused (Connection refused)
  • via GitHub by artembilan
    , 1 year ago
    java.net.ConnectException: Connection refused: connect
  • java.net.ConnectException: Connection refused
  • Stack trace

    • org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62)[spring-rabbit-1.6.1.RELEASE.jar:na] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:309)[spring-rabbit-1.6.1.RELEASE.jar:na] at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:547)[spring-rabbit-1.6.1.RELEASE.jar:na] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils$1.createConnection(ConnectionFactoryUtils.java:90)[spring-rabbit-1.6.1.RELEASE.jar:na] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.doGetTransactionalResourceHolder(ConnectionFactoryUtils.java:140)[spring-rabbit-1.6.1.RELEASE.jar:na] at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.getTransactionalResourceHolder(ConnectionFactoryUtils.java:76)[spring-rabbit-1.6.1.RELEASE.jar:na] at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1374)[spring-rabbit-1.6.1.RELEASE.jar:na] at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1367)[spring-rabbit-1.6.1.RELEASE.jar:na] at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1343)[spring-rabbit-1.6.1.RELEASE.jar:na] at org.springframework.amqp.rabbit.core.RabbitAdmin.declareExchange(RabbitAdmin.java:156)[spring-rabbit-1.6.1.RELEASE.jar:na] at org.springframework.cloud.stream.binder.rabbit.RabbitMessageChannelBinder.declareExchange(RabbitMessageChannelBinder.java:491)[spring-cloud-stream-binder-rabbit-1.0.3.RELEASE.jar:1.0.3.RELEASE] at org.springframework.cloud.stream.binder.rabbit.RabbitMessageChannelBinder.buildOutboundEndpoint(RabbitMessageChannelBinder.java:355)[spring-cloud-stream-binder-rabbit-1.0.3.RELEASE.jar:1.0.3.RELEASE] at org.springframework.cloud.stream.binder.rabbit.RabbitMessageChannelBinder.doBindProducer(RabbitMessageChannelBinder.java:407)[spring-cloud-stream-binder-rabbit-1.0.3.RELEASE.jar:1.0.3.RELEASE] at org.springframework.cloud.stream.binder.rabbit.RabbitMessageChannelBinder.doBindProducer(RabbitMessageChannelBinder.java:102)[spring-cloud-stream-binder-rabbit-1.0.3.RELEASE.jar:1.0.3.RELEASE] at org.springframework.cloud.stream.binder.AbstractBinder.bindProducer(AbstractBinder.java:184)[spring-cloud-stream-1.0.3.RELEASE.jar:1.0.3.RELEASE] at org.springframework.cloud.stream.binding.ChannelBindingService.bindProducer(ChannelBindingService.java:113)[spring-cloud-stream-1.0.3.RELEASE.jar:1.0.3.RELEASE] at org.springframework.cloud.stream.binding.BindableProxyFactory.bindOutputs(BindableProxyFactory.java:206)[spring-cloud-stream-1.0.3.RELEASE.jar:1.0.3.RELEASE] at org.springframework.cloud.stream.binding.OutputBindingLifecycle.start(OutputBindingLifecycle.java:57)[spring-cloud-stream-1.0.3.RELEASE.jar:1.0.3.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:346)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:149)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:112)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:874)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE] at org.springframework.cloud.stream.aggregate.AggregateApplicationBuilder.<init>(AggregateApplicationBuilder.java:60)[spring-cloud-stream-1.0.3.RELEASE.jar:1.0.3.RELEASE] at org.springframework.cloud.stream.aggregate.AggregateApplicationBuilder.<init>(AggregateApplicationBuilder.java:56)[spring-cloud-stream-1.0.3.RELEASE.jar:1.0.3.RELEASE] at com.capitalone.digitalmessagingsystem.stream.config.Application.main(Application.java:18)[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_60] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_60] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_60] at java.lang.reflect.Method.invoke(Method.java:497)[na:1.8.0_60] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)[idea_rt.jar:na] Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method)[na:1.8.0_60] at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)[na:1.8.0_60] at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)[na:1.8.0_60] at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)[na:1.8.0_60] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)[na:1.8.0_60] at java.net.Socket.connect(Socket.java:589)[na:1.8.0_60] at com.rabbitmq.client.impl.FrameHandlerFactory.create(FrameHandlerFactory.java:32)[amqp-client-3.6.3.jar:na] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:811)[amqp-client-3.6.3.jar:na] at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:725)[amqp-client-3.6.3.jar:na] at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:296)[spring-rabbit-1.6.1.RELEASE.jar:na] ... 37 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    2 times, 7 months ago
    3 times, 6 months ago
    Once, 11 months ago
    Unknown user
    Once, 1 year ago
    Once, 1 month ago
    483 more bugmates