0

次のエンティティがあります。

@Entity
@Table(name = "ct_users")
@JsonIgnoreProperties("password", "enabled", "driver", "reviews")
open class User(

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    val id: Int = 0,

    @Column
    val phone: String = "",

    @Column
    val password: String = "",

    @Column
    val enabled: Boolean = false,

    @OneToOne(fetch = FetchType.LAZY, mappedBy="profile")
    var driver: Driver? = null,

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(
        name = "ct_reviews_rel",
        joinColumns = arrayOf(JoinColumn(name = "user_id")),
        inverseJoinColumns = arrayOf(JoinColumn(name = "review_id"))
    )
    @JsonManagedReference
    var reviews: List<Review>? = null

) : Serializable

関連するドライバーの表:

@Entity
@Table(name = "ct_drivers")
@JsonIgnoreProperties("password", "profile")
class Driver(

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    var id: Int = 0,

    @Column(name = "first_name")
    var firstName: String = "",

    @Column(name = "last_name")
    var lastName: String = "",

    @Column(name = "rating")
    var rating: Double = 5.0,

    @Column(name = "reviews")
    var reviewsCount: Int = 0,

    @Column(name = "invited_by")
    var invitedBy: Int? = 0,

    @Column(name = "position_prev", columnDefinition = "geometry(Point,4326)")
    var positionPrev: Point = Helpers.geometry(0.0, 0.0),

    @Column(columnDefinition = "geometry(Point,4326)")
    var position: Point = Helpers.geometry(0.0, 0.0),

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    var profile: User? = null,

    @Transient
    var distance: Int = 0

) : Serializable

トークンを更新しようとすると (/oauth/token?grant_type=refresh_token&client_id=abc&client_secret=abcd&refresh_token=...)、次のエラー メッセージが表示されます。

{
  "error": "server_error",
  "error_description": "java.io.NotSerializableException: org.geolatte.geom.jts.PointSequenceCoordinateSequenceFactory"
}

どうすれば修正できますか?そして、この問題の原因は何ですか?

Helpers.geometry 関数:

    fun geometry(lat: Double, lng: Double): Point {
        return GeometryFactory(PrecisionModel(), 4326).createPoint(Coordinate(lat, lng))
    }
4

1 に答える 1