facebook

net.sf.hibernate.MappingException: No persister for:

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #218172 Reply

    mike.pell
    Member

    Please help me get started.
    2 days, and I still can’t have a 2nd object without seeing this:
    net.sf.hibernate.MappingException: No persister for: com.ihc.MikesTable

    I had very good luck creating 1 table, 1 object. And it all worked just fine. Very nice indeed.
    So, I created a 2nd persistent object in the same fashion as the 1st.

    All appears to be correct, even the hibernate.cfg.xml has the 2nd entry:
    <!– mapping files –>
    <mapping resource=”com/ihc/MikesTable.hbm.xml”/>
    <mapping resource=”com/ihc/Item.hbm.xml”/>

    When I run my test client, the Item test works great, but the ‘mikesTable’ test results in the above exception, no matter what I do.
    I’ve clean built, manually deleted files, rebuild, copy files, manually copy files, etc.
    It seems to me that it doesn’t recognize the additional mapping resource.

    I have a very simple Java app using MySql with the connector/J driver.
    No Tomcat, no app server, no Struts, no nothing to confuse the issue.

    Please suggest what I’m doing wrong.

    Also, is there a sample Eclipse project that I can download and run? A working example goes a long way.

    Thanks,
    Mike

    #218210 Reply

    mike.pell
    Member

    Don’t forget to add your new classes to the Configuration!

    * Configuration cfg = new Configuration().
    * addClass(Foo.class).
    * addClass(Bar.class);
    *
    */
    Configuration cfg = new Configuration().addClass(UpChannel.class).
    addClass(Customer.class).
    addClass(MikesTable.class).
    addClass(Item.class);

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: net.sf.hibernate.MappingException: No persister for:

You must be logged in to post in the forum log in