Checklist
Affected version
2.1.0
Steps to reproduce the bug
Try to store a record with an enum.
Expected behavior
No exception
Actual behavior
java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.String java.lang.Enum.name accessible: module java.base does not "opens java.lang" to unnamed module @411f53a0
Additional information
@Component
public class ClockEclipseAdapter implements ClockRepository {
private final EclipseClockRepository repository;
private static final Logger log = LoggerFactory.getLogger(ClockEclipseAdapter.class);
public ClockEclipseAdapter(EclipseClockRepository repository) {
this.repository = repository;
}
@Override
public void save(ClockEvent clockEvent) {
repository.save(clockEvent);
}
@Override
public List<ClockEvent> findAll() {
return repository.findAll();
}
}
public interface EclipseClockRepository extends ListCrudRepository<ClockEvent, Long> {
}
public record ClockEvent(LocalDateTime time, ClockEventType type) {
public ClockEvent {
if (time == null) {
throw new IllegalArgumentException("Event time is empty");
}
if (type == null) {
throw new IllegalArgumentException("Event type is empty");
}
}
}
public enum ClockEventType {
IN,
OUT
}
Checklist
Affected version
2.1.0
Steps to reproduce the bug
Try to store a record with an enum.
Expected behavior
No exception
Actual behavior
java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.String java.lang.Enum.name accessible: module java.base does not "opens java.lang" to unnamed module @411f53a0
Additional information