Tag Archives: RabbitMQ

[Solved] org.springframework.context.ApplicationContextException: Failed to start bean ‘org.springframework.a

Error

org.springframework .context.ApplicationContextException: Failed to start bean &#39 ;org.springframework.amqp.rabbit.config.internalRabbitListenerEndpointRegistry'; nested exception is org.springframework.amqp.AmqpIllegalStateException: Fatal exception on listener startup

Errors reported when using RabbitMq to test switches and queues

Think hard

At first I thought it was the queue’s listener configuration information and listener code that were written wrong,I checked it repeatedly and there was no error.
Then continue to read the error ,there are these two errors,instant epiphany.

Caused by: org.springframework.amqp.AmqpIllegalStateException: Fatal exception on listener startup
Caused by: org.springframework.amqp. AmqpAuthenticationException: com. rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED

Suddenly realized

ACCESS_REFUSEDSuch a big word, I read it several times, but I didn’t expect this error, It is probably the wrong copy when configuring the password

spring:
  rabbitmq:
    host: 192.168.149.128
    port: 5672
    virtual-host: /hotel
    username: hotel
    password: hotel

hotel was resolutely written as guest

Ok, change the password, successfully run, also warn everyone to be careful!!!

[Solved] Error: unable to perform an operation on node ‘rabbit@DESKTOP-xxx‘. Please see diagnostics informa

1. Recurrence problem

Today, I logged in to the rabbitmq background management. After inputting the user name and password, this error was reported: not management user, as shown in the following figure:

So I decided to execute the command rabbitmqctl list_users check whether there is this user.

  1. First D:\Software\rabbitmq\rabbitmq_server-3.8.15\sbinenter in the directory cmd:

  1. Execute the following command in the cmdcommand window:
rabbitmqctl list_users

But the following error is reported:

D:\Software\rabbitmq\rabbitmq_server-3.8.15\sbin>rabbitmqctl list_users
Error: unable to perform an operation on node 'rabbit@DESKTOP-UVTEHFR'. Please see diagnostics information and suggestions below.

Most common reasons for this are:

 * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
 * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
 * Target node is not running

In addition to the diagnostics info below:

 * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
 * Consult server logs on node rabbit@DESKTOP-UVTEHFR
 * If target node is configured to use long node names, don't forget to use --longnames with CLI tools

DIAGNOSTICS
===========

attempted to contact: ['rabbit@DESKTOP-UVTEHFR']

rabbit@DESKTOP-UVTEHFR:
  * connected to epmd (port 4369) on DESKTOP-UVTEHFR
  * epmd reports: node 'rabbit' not running at all
                  no other nodes on DESKTOP-UVTEHFR
  * suggestion: start the node

Current node details:
 * node name: 'rabbitmqcli-999-rabbit@DESKTOP-UVTEHFR'
 * effective user's home directory: C:\Users\zxy
 * Erlang cookie hash: pkFzX53V7Ok1QDOYqiMzXg==

3. Solving problems

Copy the .erlang.cookie file from the C:\user\your username\ directory to the C:\Windows\System32\config\systemprofile\ directory, as follows:

If the .erlang.cookie file already exists in C:\Windows\System32\config\systemprofile\, just use the .erlang.cookie file in the C:\user\your username\ directory to replace it.

Double-click rabbitmq-server.bat to restart the rabbitmq service, as shown in the following image:


In the cmd command line window, enter rabbitmqctl list_users again:

[Solved] Rabbitmq Startup Error: Job for rabbitmq-server.service failed because the control process exited with

Rabbitmq Startup Error:

Redirecting to /bin/systemctl status rabbitmq-server.service
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
Active: inactive (dead) (Result: exit-code) since 四 2021-06-17 18:01:07 CST; 1min 21s ago
Process: 6558 ExecStop=/usr/sbin/rabbitmqctl shutdown (code=exited, status=69)
Process: 6398 ExecStart=/usr/sbin/rabbitmq-server (code=exited, status=1/FAILURE)
Main PID: 6398 (code=exited, status=1/FAILURE)

June 17 18:01:00 xxxx systemd[1]: Failed to start RabbitMQ broker.
June 17 18:01:00 xxxx systemd[1]: Unit rabbitmq-server.service entered failed state.
June 17 18:01:00 xxxx systemd[1]: rabbitmq-server.service failed.
June 17 18:01:07 xxxx systemd[1]: Stopped RabbitMQ broker.
[root@xxxx /]# /sbin/service rabbitmq-server start
Redirecting to /bin/systemctl start rabbitmq-server.service
Job for rabbitmq-server.service failed because the control process exited with error code. See “systemctl status rabbitmq-server.service” and “journalctl -xe” for details.

Operating Environment
Operating system/software

Version

Linux xxxx3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
CentOS 7.x
erlang-21.3-1.el7.x86_64
21.3-1
rabbitmq-server-3.8.8-1.el7.noarch
3.8.8-1

Cause Analysis
According to the error log, there are two common causes.

erlang is not installed , resulting in a startup error.
First check whether erlang is installed.

    1. ①.rpm -qa | grep erlang
[root@xxxx /]# rpm -qa|grep erlang
erlang-21.3-1.el7.x86_64

If erlang is not installed, result like “erlang-21.3-1.el7.x86_64” will not be displayed.

A host file configuration problem that causes the mq to not be read at startup.

[root@xxxx /]# vim /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.38.110 xxxx

If in the hosts file, the ip-hostname mapping is not added, just add it.
Remark.
To get the hostname.

[root@xxxx /]# hostname
xxxx

XXXX is the host name

Restart rabbitmq

[root@xxxx /]# systemctl restart rabbitmq-server 
[root@xxxx /]# systemctl status rabbitmq-server
● rabbitmq-server.service - RabbitMQ broker
   Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
   Active: active (running) since 四 2021-06-17 19:07:19 CST; 56s ago
  Process: 11504 ExecStop=/usr/sbin/rabbitmqctl shutdown (code=exited, status=0/SUCCESS)
 Main PID: 11551 (beam.smp)
   Status: "Initialized"
   CGroup: /system.slice/rabbitmq-server.service
           ├─11551 /usr/lib64/erlang/erts-10.3/bin/beam.smp -W w -K true -A 64 -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 10485...
           ├─11655 erl_child_setup 32768
           ├─11699 inet_gethost 4
           └─11700 inet_gethost 4

6月 17 19:07:16 xxxx rabbitmq-server[11551]: ##########  Licensed under the MPL 2.0. Website: https://rabbitmq.com
6月 17 19:07:16 xxxx rabbitmq-server[11551]: Doc guides: https://rabbitmq.com/documentation.html
6月 17 19:07:16 xxxx rabbitmq-server[11551]: Support:    https://rabbitmq.com/contact.html
6月 17 19:07:16 xxxx rabbitmq-server[11551]: Tutorials:  https://rabbitmq.com/getstarted.html
6月 17 19:07:16 xxxx rabbitmq-server[11551]: Monitoring: https://rabbitmq.com/monitoring.html
6月 17 19:07:16 xxxx rabbitmq-server[11551]: Logs: /var/log/rabbitmq/[email protected]
6月 17 19:07:16 xxxx rabbitmq-server[11551]: /var/log/rabbitmq/rabbit@xxxx_upgrade.log
6月 17 19:07:16 xxxx rabbitmq-server[11551]: Config file(s): (none)
6月 17 19:07:19 xxxx rabbitmq-server[11551]: Starting broker... completed with 3 plugins.
6月 17 19:07:19 xxxx systemd[1]: Started RabbitMQ broker.

The operation is successful, and the problem has been solved.

RabbitMQ:[error] Error when reading /Users/sixcandy/.erlang.cookie: eacces

RabbitMQ:[error] Error when reading /Users/sixcandy/.erlang.cookie: eacces

[error] Error when reading /Users/sixcandy/.erlang. cookie: eacces

Problem Description:

Enter the command in the MAC terminal: rabbitmqctl list_ users

Then It began to report mistakes crazily!

I feel that I have no permission, so I try to add sudo in front!

sudo rabbitmqctl list_users

success!

[Solved] JAVA Connect rabbitMQ Error: An unexpected connection driver error occured

Rabbitmq cannot be connected in the Java project. The error content is as follows:

ERROR com.rabbitmq.client.impl.ForgivingExceptionHandler.log(ForgivingExceptionHandler.java:119) - An unexpected connection driver error occured

An unexpected connection driver error occurred

Most likely, the newly created user is not authorized

1. You need to confirm that the default port 15672 is the port browsed by the browser after MQ is installed on the server, it needs to be configured as 5672 in the project.

2. Creating a new user requires authorization.
adding a user

Or

After the creation is successful, click the newly created user

User authorization

Then you can connect with the newly created user

The yellow No access will change to /, which indicates that the authorization is successful.

[Solved] RabbitMQ Error: Error creating bean with name ‘rabbitConnectionFactory‘ defined in class path resource

1. Error Messages:

Error creating bean with name 'rabbitConnectionFactory' defined in class path resource [org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration$RabbitConnectionFactoryCreator.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.amqp.rabbit.connection.CachingConnectionFactory]: Factory method 'rabbitConnectionFactory' threw exception; nested exception is java.lang.IllegalArgumentException: Address 192.168.74.128:5672:5672 seems to contain an unquoted IPv6 address. Make sure you quote IPv6 addresses like so: [2001:db8:85a3:8d3:1319:8a2e:370:7348]
2. Reason
Address 192.168.74.128:5672:5672 seems to contain an unquoted IPv6 address. Make sure you quote IPv6 addresses like so: [2001:db8:85a3:8d3:1319:8a2e:370:7348]
Identified as ipv6, rabbitmq should also support IPV6
3. Solution
application.yml File

 rabbitmq:
  #host: 192.168.74.128:5672//去掉端口
  host: 192.168.74.128
  username: admin
  password: 123123
  virtual-host: /

[Solved] rabbitMQ: factory.newConnection() Error: com.rabbitmq.client.ShutdownSignalException

About rabbitmq: factory Newconnection() reported an error com rabbitmq. client.ShutdownSignalException
exception information

Exception in thread "main" java.io.IOException
	at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:129)
	at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:125)
	at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:147)
	at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:439)
	at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:65)
	at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:160)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1216)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1173)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1131)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1294)
	at util.ConnectionUtil.getConnection(ConnectionUtil.java:40)
	at Foundation_auto ACK.Send.main(Send.java:27)
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=530, reply-text=NOT_ALLOWED - vhost /kavito not found, class-id=10, method-id=40)
	at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66)
	at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
	at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:502)
	at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:293)
	at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:141)
	... 9 more

tools

public class ConnectionUtil {
    private static final String HOST = "127.0.0.1";
    /**
     * Here java access requires the use of 5672;
     * web access uses 15672;
     */
    private static final Integer PORT = 5672;
    private static final String VIRTUAL_HOST = "/kavito";
    private static final String USERNAME = "chen";
    private static final String PASSWORD = "a123";

    public static Connection getConnection() throws IOException, TimeoutException {
        // Define the connection factory
        ConnectionFactory factory = new ConnectionFactory();
        // Service address
        factory.setHost(HOST);
        // Port
        factory.setPort(PORT);

        // set account information, username, password, vhost
        // set virtual machine, one mq service can set multiple virtual machines, each virtual machine is equivalent to a separate mq
        factory.setVirtualHost(VIRTUAL_HOST);
        factory.setUsername(USERNAME);
        factory.setPassword(PASSWORD);

        // Get the connection through the factory
        Connection connection = factory.newConnection();
        return connection;
    }
}

problem-solving: my solution is not to use the online setting permission

Reference commands for setting permissions
rabbitmqctl set_permissions -p "/" username ".*" ".*" ".*"

My problem is caused by setting the virtual machine
the default virtual machine on rabbitmq is

and the virtual machine set in my code is

Solution:
the first Change the virtual machine in the code to

the second Create a new virtual machine named/kavito in rabbitmq (PS: the name here depends on your actual situation)

and set permissions for the corresponding user

Euopenler 21.09 sudo Yum Update Error: Errors during downloading metadata for repository ‘EPOL’

openEuler
openEuler-21.09-everything-x86_64-dvd.iso
sudo yum update error

EPOL
Errors during downloading metadata for repository 'EPOL':
	-Status code: 404 for htpp://repo.openeuler.org/openEuler-21.09/EPOL/repomd.xml

Please note that:

sudo vi/etc/yum.rest.d/openeuler.repo

Please note that

[EPOL]
name=EPOL
baseurl=http://repo.openeuler.org/openEuler-21.09/EPOL/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.09/OS/$basearch/RPM-GPG-KEY-openEuler

The correct address is:

name=EPOL
baseurl= http://repo.openeuler.org/openEuler-21.09/EPOL/main/ $basearch/

Save, exit and execute again.

Linux: How to Solve Rabbitmq Plug-in Install Error

After rabitmq is installed normally, rabbitmq server starts normally, but rabbitmq_ The management plug-in failed to start and reported an error:

rabbitmq-plugins enable rabbitmq_management
{:query, :rabbit@web101, {:badrpc, :timeout}}

Solution:
add the Linux host number and host name at the end of the hosts file
method: VI/etc/hosts
Edit by I
host number host name
for example: 192.168.1.1 localhost (fill in your own here)
after adding: WQ save exit
at this time, you can view the rabbitmq plug-in

After rabbitmq is started and the plug-in is also enabled, the page cannot be accessed
the firewall may not be closed

Solution: turn off the Linux firewall

(1) Set boot enable firewall: systemctl enable firewalld.service

(2) Set boot disable firewall: systemctl disable firewalld.service

(3) Start firewall: systemctl start firewalld

(4) Turn off the firewall: systemctl stop firewalld

(5) Check firewall status: systemctl status firewalld