java.lang.IllegalStateException: Could not access method: Class org.springframework.util.ReflectionUtils can not access a member of class ExtendedRevision with modifiers "private"

Spring JIRA | Andrei Ivanov | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Trying to use a custom Envers revision class: {code} @Entity @RevisionEntity(ExtendedRevisionListener.class) @Table(name = "revinfo") public class ExtendedRevision implements Serializable { @Id @GeneratedValue @Column(name = "REV") @RevisionNumber private Integer id; @RevisionTimestamp @Temporal(TemporalType.TIMESTAMP) @Column(name = "REVTSTMP", nullable = false) private Date date; @Column(nullable = false, length = 15) private String username; public Integer getId() { return id; } public Date getDate() { return date; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } {code} triggers this error: {noformat} java.lang.IllegalStateException: Could not access method: Class org.springframework.util.ReflectionUtils can not access a member of class ExtendedRevision with modifiers "private" at org.springframework.util.ReflectionUtils.handleReflectionException(ReflectionUtils.java:262) at org.springframework.util.ReflectionUtils.getField(ReflectionUtils.java:132) at org.springframework.data.util.AnnotationDetectionFieldCallback.getValue(AnnotationDetectionFieldCallback.java:82) at org.springframework.data.history.AnnotationRevisionMetadata.<init>(AnnotationRevisionMetadata.java:54) {noformat} I assume the fields have to be made accessible from the field callback.

    Spring JIRA | 2 years ago | Andrei Ivanov
    java.lang.IllegalStateException: Could not access method: Class org.springframework.util.ReflectionUtils can not access a member of class ExtendedRevision with modifiers "private"
  2. 0

    Trying to use a custom Envers revision class: {code} @Entity @RevisionEntity(ExtendedRevisionListener.class) @Table(name = "revinfo") public class ExtendedRevision implements Serializable { @Id @GeneratedValue @Column(name = "REV") @RevisionNumber private Integer id; @RevisionTimestamp @Temporal(TemporalType.TIMESTAMP) @Column(name = "REVTSTMP", nullable = false) private Date date; @Column(nullable = false, length = 15) private String username; public Integer getId() { return id; } public Date getDate() { return date; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } {code} triggers this error: {noformat} java.lang.IllegalStateException: Could not access method: Class org.springframework.util.ReflectionUtils can not access a member of class ExtendedRevision with modifiers "private" at org.springframework.util.ReflectionUtils.handleReflectionException(ReflectionUtils.java:262) at org.springframework.util.ReflectionUtils.getField(ReflectionUtils.java:132) at org.springframework.data.util.AnnotationDetectionFieldCallback.getValue(AnnotationDetectionFieldCallback.java:82) at org.springframework.data.history.AnnotationRevisionMetadata.<init>(AnnotationRevisionMetadata.java:54) {noformat} I assume the fields have to be made accessible from the field callback.

    Spring JIRA | 2 years ago | Andrei Ivanov
    java.lang.IllegalStateException: Could not access method: Class org.springframework.util.ReflectionUtils can not access a member of class ExtendedRevision with modifiers "private"

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Could not access method: Class org.springframework.util.ReflectionUtils can not access a member of class ExtendedRevision with modifiers "private"

      at org.springframework.util.ReflectionUtils.handleReflectionException()
    2. Spring Core
      ReflectionUtils.getField
      1. org.springframework.util.ReflectionUtils.handleReflectionException(ReflectionUtils.java:262)
      2. org.springframework.util.ReflectionUtils.getField(ReflectionUtils.java:132)
      2 frames
    3. Spring Data Core
      AnnotationRevisionMetadata.<init>
      1. org.springframework.data.util.AnnotationDetectionFieldCallback.getValue(AnnotationDetectionFieldCallback.java:82)
      2. org.springframework.data.history.AnnotationRevisionMetadata.<init>(AnnotationRevisionMetadata.java:54)
      2 frames