hibernate properties not found

I guess the problem is with the code for configuration you mentioned for .hbm.xml may not be working in Tomcat. I think it needs AnnotationConfiguration object. I guess you used this code due to the Annotationconfiguration object creation is not working. Better create a maven hibernate project with pom and export the war file to Tomcat (with the changes of Annotationconfiguration). Also use log4j … Read more

Hibernate Error: a different object with the same identifier value was already associated with the session

Most probably its because the B objects are not referring to the same Java C object instance. They are referring to the same row in the database (i.e. the same primary key) but they’re different copies of it. So what is happening is that the Hibernate session, which is managing the entities would be keeping … Read more

How to fix the Hibernate “object references an unsaved transient instance – save the transient instance before flushing” error

You should include cascade=”all” (if using xml) or cascade=CascadeType.ALL (if using annotations) on your collection mapping. This happens because you have a collection in your entity, and that collection has one or more items which are not present in the database. By specifying the above options you tell hibernate to save them to the database when saving their parent.

PersistentObjectException: detached entity passed to persist thrown by JPA and Hibernate

This is a typical bidirectional consistency problem. It is well discussed in this link as well as this link. As per the articles in the previous 2 links you need to fix your setters in both sides of the bidirectional relationship. An example setter for the One side is in this link. An example setter … Read more

How to fix the Hibernate “object references an unsaved transient instance – save the transient instance before flushing” error

You should include cascade=”all” (if using xml) or cascade=CascadeType.ALL (if using annotations) on your collection mapping. This happens because you have a collection in your entity, and that collection has one or more items which are not present in the database. By specifying the above options you tell hibernate to save them to the database when saving their parent.

What are the possible values of the Hibernate hbm2ddl.auto configuration and what do they do

From the community documentation: hibernate.hbm2ddl.auto Automatically validates or exports schema DDL to the database when the SessionFactory is created. With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly. e.g. validate | update | create | create-drop So the list of possible options are, validate: validate the schema, makes no changes to … Read more

HTTP Status 405 – Request method ‘POST’ not supported (Spring MVC)

I found the problem that was causing the HTTP error. In the setFalse() function that is triggered by the Save button my code was trying to submit the form that contained the button. when I remove the document.submitForm.submit(); it works: @Roger Lindsjö Thank you for spotting my error where I wasn’t passing on the right parameter!