• Register
0 votes
5.7k views

Problem :

I am very new to the hibernate and I want to set up two classes. Also want to create a one to one bidirectional dependency using annotations. I have added all the libraries to the build path.

But when i try to run the simple main class by creating some objects and saving them, for testing purpose I face the following issues.

INFO: HHH000397: Using ASTQueryTranslatorFactory
%%%% Error Creating SessionFactory %%%% 
org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister

Because of this error I am confused. My  SQL DB is running via XAMPP.

May I get the solution for above error?

7.5k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I guess you must be missing the setter method for your some property as pointed by the exception

Please try add the setter as follows :

 public void setSome (long some) {
      this. some = some;
 }

 

If above solution is not working for you then you must be having the problem because of conflicting Jars.

Below is the full list of jars which is working absolutely fine for me.

antlr-2.7.7.jar
byte-buddy-1.8.12.jar
c3p0-0.9.5.2.jar
classmate-1.3.4.jar
dom4j-1.6.1.jar
geolatte-geom-1.3.0.jar
hibernate-c3p0-5.3.1.Final.jar
hibernate-commons-annotations-5.0.3.Final.jar
hibernate-core-5.3.1.Final.jar
hibernate-envers-5.3.1.Final.jar
hibernate-jpamodelgen-5.3.1.Final.jar
hibernate-osgi-5.3.1.Final.jar
hibernate-proxool-5.3.1.Final.jar
hibernate-spatial-5.3.1.Final.jar
jandex-2.0.3.Final.jar
javassist-3.22.0-GA.jar
javax.interceptor-api-1.2.jar
javax.persistence-api-2.2.jar
jboss-logging-3.3.2.Final.jar
jboss-transaction-api_1.2_spec-1.1.1.Final.jar
jts-core-1.14.0.jar
mchange-commons-java-0.2.11.jar
mysql-connector-java-5.1.21.jar
org.osgi.compendium-4.3.1.jar
org.osgi.core-4.3.1.jar
postgresql-42.2.2.jar
proxool-0.8.3.jar
slf4j-api-1.6.1.jar

 

38.6k points

Related questions

0 votes
1 answer 69 views
69 views
Problem : May I get the solution for above error: Could not get constructor for org.hibernate.persister.entity.singletableentitypersister.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 21 views
21 views
Problem: Is it possible to make this work: Caused by: org.hibernate.annotationexception: no identifier specified for the entity?
asked Jun 13 Nahil 128k points
0 votes
1 answer 164 views
164 views
Problem: Why am I getting this exception? package com.domain.idea; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; ... (AnnotationConfiguration.java:867) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) ... 145 more
asked May 2 Yeamin 23.5k points
0 votes
1 answer 6 views
6 views
Problem : How do I solve it: Org.hibernate.annotationexception: no identifier specified for entity?
asked Jun 17 Siam55 110k points
0 votes
1 answer 31 views
31 views
Problem: I had successfully written my first master child example with hibernate. After few days I took it again and upgraded some libraries. No sure what did I do but I could never make it run again. Would somebody help my figure out what is wrong ... same error message that is forcing me to believe that something is wrong either with hibernate configuration file or entity classes or save method.
asked May 1 muktaa 34.6k points
0 votes
1 answer 40 views
40 views
Problem: I had successfully written my first master child example with hibernate. After few days I took it again and upgraded some libraries. No sure what did I do but I could never make it run.
asked Apr 30 salim1 60.6k points
0 votes
1 answer 37 views
37 views
Problem: I'm trying to come up with a solution for this: Org.hibernate.exception.dataexception: could not execute statement
asked Jun 19 nila 121k points
0 votes
1 answer 7 views
7 views
Problem: Does this happen to someone else: Org.hibernate.hibernateexception: could not parse configuration: /hibernate.cfg.xml?
asked Jun 14 akhi 125k points
0 votes
1 answer 38 views
38 views
We are currently looking into upgrading our application to Corda V3.1 from Corda V2. One of our tests where we are using the SendTransactionFlow failed with a hibernate exception. It turned out that calling ServiceHub.recordTransaction fails if the transaction ... ), contractName<TestContract>()) sign(node1.services) } node1.services.recordTransactions(tx) node1.services.recordTransactions(tx) } }
asked May 24 Yash verma 4k points
0 votes
1 answer 37 views
37 views
Problem: Help! Why I get the following exception > Org.hibernate.lazyinitializationexception: could not initialize proxy - no session
asked Apr 25 ummeshani 10.8k points