Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4235968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:34:30+00:00 2026-05-21T02:34:30+00:00

I’ve got this problem that It always hit the PropertyAccessException when trying to saveOrUpdate();

  • 0

I’ve got this problem that It always hit the PropertyAccessException when trying to saveOrUpdate(); I’m using Spring 3 and hibernate 3.6 with tomcat 7.

I’ve got a M-M Akte to Pemilik

Here is the code: (Simple properties are omitted for the sake of brevity)

public class Akte implements Serializable, Comparable {
    private Long id;
    private int version;

    AutoPopulatingList pemiliks; 

    public Akte() {
    }


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }


    public AutoPopulatingList getPemiliks() {
        return pemiliks;
    }

    public void setPemiliks(AutoPopulatingList pemiliks) {
        this.pemiliks = pemiliks;
    }

}

public class Pemilik implements Serializable {
    private Long id;
    private int version;
    private Set aktes = new HashSet();

    public Pemilik() {}

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public Set getAktes() {
        return aktes;
    }

    public void setAktes(Set aktes) {
        this.aktes = aktes;
    }

}

here are the mapping files

<hibernate-mapping package="com.notaris.beans">

    <class name="Akte" table="AKTE" dynamic-insert="true" dynamic-update="true" lazy="true">


        <id name="id" column="AKTE_ID">

            <generator class="native"/>

        </id>

        <version name="version" column="VERSION"/>

        <bag name="pemiliks" table="AKTE_PEMILIK" lazy="true" cascade="save-update">
           <key column="AKTE_ID"/>
           <many-to-many class="Pemilik" column="PEMILIK_ID"/>
        </bag>


    </class>
</hibernate-mapping>


<hibernate-mapping package="com.notaris.beans">
    <class name="Pemilik" table="PEMILIK" lazy="true">
        <id name="id" column="PEMILIK_ID">
           <generator class="native"/>
        </id>
        <version name="version" column="VERSION"/>
        <set name="aktes" table="AKTE_PEMILIK" lazy="true" inverse="true" cascade="save-update">
            <key column="PEMILIK_ID"/>
            <many-to-many class="Akte" column="AKTE_ID"/>
        </set>
    </class>
</hibernate-mapping>

now i was trying to save it during processFinish()

by doing something like:
akteService.createAkte(cmd.getAkte());
Inside the Akte there is a AutoPopulatingList that contained Pemilik object.
and AutoPopulatingList is initiated the simple way new AutoPopulatingList(Pemilik.class);

and here is the stack trace

org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.notaris.beans.Akte.pemiliks
org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:128)
org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:583)
org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:229)
org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3822)
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:299)
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:673)
org.springframework.orm.hibernate3.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:740)
org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:737)
com.notaris.dao.AkteDaoImpl.createAkte(AkteDaoImpl.java:26)
com.notaris.service.AkteService.createAkte(AkteService.java:22)
com.notaris.controller.AddAkteController.processFinish(AddAkteController.java:228)
org.springframework.web.servlet.mvc.AbstractWizardFormController.validatePagesAndFinish(AbstractWizardFormController.java:650)
org.springframework.web.servlet.mvc.AbstractWizardFormController.processFormSubmission(AbstractWizardFormController.java:500)
org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:268)
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

Any ideas guys?
I’ve taken a look at the pemiliks property, it’s just a simple AutoPopulatingList, I dont
understand what’s the issue with the setter not able to access it?
Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T02:34:30+00:00Added an answer on May 21, 2026 at 2:34 am

    The type of a collection that needs to be managed by hibernate should be a java.util.Set or List. The error is most likely due to pemiliks being of type AutoPopulatingList, change it to a List (also the setter & getter). You can initialize the collection to an instance of AutoPopulatingList.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've got a string that has curly quotes in it. I'd like to replace
i got an object with contents of html markup in it, for example: string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.