Getting "org.infinispan.server.hotrod.InvalidMagicIdException: Error reading magic byte or message" error when trying to connect to Red Hat JBoss Data Grid 7.2 via Spring Boot application

Solution Verified - Updated -

Environment

  • Red Hat JBoss Data Grid
    • 7.2

Issue

  • While trying to connect to JDG 7.2 via Spring Boot application version 2.x, the error org.infinispan.server.hotrod.InvalidMagicIdException: Error reading magic byte or message is appearing in the logs
  • Can't connect to a JDG server 7.2.x using a Spring Boot application

Resolution

As a workaround use Hot Rod protocol version 2.5 by setting the parameter infinispan.client.hotrod.protocol_version = 2.5 in the Spring Boot application properties file.

Root Cause

Red Hat JBoss Data Grid 7.2.x is based on Infinispan 9.4.x and not certified on Spring Boot 2.x libraries.

Spring Boot 1.5.17 and 2.x have been tested for integration with RHDG 7.3. See Red Hat Data Grid 7 Supported Configurations.

Diagnostic Steps

Open the application log and search for: org.infinispan.server.hotrod.InvalidMagicIdException: Error reading magic byte or message message.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.