org.springframework.orm.hibernate3.HibernateSystemException:调用 getter 时发生 IllegalArgumentException

发布于 2024-12-10 01:23:12 字数 2373 浏览 0 评论 0原文

我面临如下所示的问题,

IllegalArgumentException occurred calling getter of org.springframework.security.oauth.examples.sparklr.models.Authority.user; 
nested exception is org.hibernate.PropertyAccessException: 
IllegalArgumentException occurred calling getter of org.springframework.security.oauth.examples.sparklr.models.Authority.user

我的休眠依赖项是:

  • hibernate-core 3.3.2.GA
  • hibernate-annotations 3.4.0.GA
  • hibernate-commons-annotations 3.3.0.ga
  • hibernate-entitymanager 3.4.0.GA
public class User implements UserDetails,Serializable {

    /** Serial Version UID. */
    private static final long serialVersionUID = -558892839L;

    /** Use a WeakHashMap so entries will be garbage collected once all entities 
        referring to a saved hash are garbage collected themselves. */
    private static final Map<Serializable, String> SAVED_HASHES =
        Collections.synchronizedMap(new WeakHashMap<Serializable, String>());

    /** hashCode temporary storage. */
    private volatile String hashCode;


    /** Field mapping. */
    private Boolean accountnonexpired;
    /** Field mapping. */
    private Boolean accountnonlocked;
    /** Field mapping. */
    private List<Authority> authorities = new ArrayList<Authority>();

    /** Field mapping. */
    private Boolean credentialsnonexpired;
    /** Field mapping. */
    private Boolean enabled;
    /** Field mapping. */
    private String id;
    /** Field mapping. */
    private String password;


       public class Authority implements Serializable ,GrantedAuthority {


    /** Serial Version UID. */
    private static final long serialVersionUID = -558892840L;

    /** Use a WeakHashMap so entries will be garbage collected once all entities 
        referring to a saved hash are garbage collected themselves. */
    private static final Map<Serializable, Serializable> SAVED_HASHES =
        Collections.synchronizedMap(new WeakHashMap<Serializable, Serializable>());

    /** hashCode temporary storage. */
    private volatile Serializable hashCode;


    /** Field mapping. */
    private String authority;
    /** Field mapping. */
    private User user;

我该如何解决谢谢你太喜欢了

i face a problem shown below

IllegalArgumentException occurred calling getter of org.springframework.security.oauth.examples.sparklr.models.Authority.user; 
nested exception is org.hibernate.PropertyAccessException: 
IllegalArgumentException occurred calling getter of org.springframework.security.oauth.examples.sparklr.models.Authority.user

my hibernate dependencies are:

  • hibernate-core 3.3.2.GA
  • hibernate-annotations 3.4.0.GA
  • hibernate-commons-annotations 3.3.0.ga
  • hibernate-entitymanager 3.4.0.GA
public class User implements UserDetails,Serializable {

    /** Serial Version UID. */
    private static final long serialVersionUID = -558892839L;

    /** Use a WeakHashMap so entries will be garbage collected once all entities 
        referring to a saved hash are garbage collected themselves. */
    private static final Map<Serializable, String> SAVED_HASHES =
        Collections.synchronizedMap(new WeakHashMap<Serializable, String>());

    /** hashCode temporary storage. */
    private volatile String hashCode;


    /** Field mapping. */
    private Boolean accountnonexpired;
    /** Field mapping. */
    private Boolean accountnonlocked;
    /** Field mapping. */
    private List<Authority> authorities = new ArrayList<Authority>();

    /** Field mapping. */
    private Boolean credentialsnonexpired;
    /** Field mapping. */
    private Boolean enabled;
    /** Field mapping. */
    private String id;
    /** Field mapping. */
    private String password;


       public class Authority implements Serializable ,GrantedAuthority {


    /** Serial Version UID. */
    private static final long serialVersionUID = -558892840L;

    /** Use a WeakHashMap so entries will be garbage collected once all entities 
        referring to a saved hash are garbage collected themselves. */
    private static final Map<Serializable, Serializable> SAVED_HASHES =
        Collections.synchronizedMap(new WeakHashMap<Serializable, Serializable>());

    /** hashCode temporary storage. */
    private volatile Serializable hashCode;


    /** Field mapping. */
    private String authority;
    /** Field mapping. */
    private User user;

how can i solve thank you so much

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无语# 2024-12-17 01:23:12

从您显示的代码来看,您没有 Authorityuser 属性的 getter。

尝试添加

public User getUser(){
    return this.user;
}

from the code you have shown, you don't have a getter for the user property of Authority.

Try adding

public User getUser(){
    return this.user;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文