Copied from the stacktrace:
BeanInstantiationException: Could not instantiate bean class [com.gestEtu.project.model.dao.CompteDAOHib]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.gestEtu.project.model.dao.CompteDAOHib.<init>()
By default, Spring will try to instantiate beans by calling a default (no-arg) constructor. The problem in your case is that the implementation of the CompteDAOHib
has a constructor with a SessionFactory
argument. By adding the @Autowired
annotation to a constructor, Spring will attempt to find a bean of matching type, SessionFactory
in your case, and provide it as a constructor argument, e.g.
@Autowired public CompteDAOHib(SessionFactory sessionFactory) { // ... }
Related Posts:
- Error creating bean with name ‘entityManagerFactory’ defined in class path resource : Invocation of init method failed
- Error creating bean with name ‘entityManagerFactory’ defined in class path resource : Invocation of init method failed
- How to solve the “failed to lazily initialize a collection of role” Hibernate exception
- Spring @PropertySources value not overriding
- HTTP Status 405 – Request method ‘POST’ not supported (Spring MVC)
- Spring boot – Request method ‘POST’ not supported. Tried everything
- Difference between spring @Controller and @RestController annotation
- Unable to create requested service [org.hibernate .engine.jdbc.env.spi.JdbcEnvironment]-MySQL
- @Autowired – No qualifying bean of type found for dependency
- HTTP Status 405 – Request method ‘POST’ not supported (Spring MVC)
- UnsatisfiedDependencyException: Error creating bean with name
- UnsatisfiedDependencyException: Error creating bean with name
- Why SpringMVC Request method ‘GET’ not supported?
- Spring boot: Unable to start embedded Tomcat servlet container
- model.addAttribute() parameters
- Spring Boot – Unable to resolve Whitelabel Error Page
- Understanding Spring @Autowired usage
- com.atomikos.icatch.SysException: Error in init: Log already in use? tmlog in ./
- “NoClassDefFoundError: Could not initialize class” error
- Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
- No String-argument constructor/factory method to deserialize from String value (”)
- org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set
- “NoClassDefFoundError: Could not initialize class” error
- “NoClassDefFoundError: Could not initialize class” error
- What is difference between CrudRepository and JpaRepository interfaces in Spring Data JPA?
- How to fix org.hibernate.LazyInitializationException – could not initialize proxy – no Session
- org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set
- org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set
- What’s the difference between session.persist() and session.save() in Hibernate?
- What’s the advantage of load() vs get() in Hibernate?
- How to resolve Error listenerStart when deploying web-app in Tomcat 5.5?
- com.sun.jdi.InvocationException occurred invoking method
- Only using @JsonIgnore during serialization, but not deserialization
- Spring Maven clean error – The requested profile “pom.xml” could not be activated because it does not exist
- What are the possible values of the Hibernate hbm2ddl.auto configuration and what do they do
- How to fix the Hibernate “object references an unsaved transient instance – save the transient instance before flushing” error
- PersistentObjectException: detached entity passed to persist thrown by JPA and Hibernate
- intellij incorrectly saying no beans of type found for autowired repository
- Could not resolve placeholder in string value
- How to fix the Hibernate “object references an unsaved transient instance – save the transient instance before flushing” error
- Is spring default scope singleton or not?
- Hibernate Error: a different object with the same identifier value was already associated with the session
- hibernate properties not found
- MultipartException: Current request is not a multipart request
- How to upload a file and JSON data in Postman?
- What kind of Java type is “[B”?
- Hibernate – Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1
- JsonMappingException: No suitable constructor found for type [simple type, class ]: can not instantiate from JSON object
- What’s the difference between JPA and Hibernate?
- How to map a composite key with JPA and Hibernate?
- Configure active profile in SpringBoot via Maven
- Downloading a file from spring controllers
- java.lang.IllegalStateException: Failed to introspect Class
- when spring boot startup,throw out the “method names must be tokens” exception
- Hibernate show real SQL
- Spring Hibernate – Could not obtain transaction-synchronized Session for current thread
- Difference between Inheritance and Composition
- What is the reason behind “non-static method cannot be referenced from a static context”? [duplicate]
- Java string to date conversion
- Creating a “logical exclusive or” operator in Java
- What is IllegalStateException?
- Long vs Integer, long vs int, what to use and when?
- Java Using Nodes with LinkedList
- When is the @JsonProperty property used and what is it used for?
- catDog string problem at Codingbat.com
- What is the difference between String.subString() and String.subSequence()
- Why Maven project is tied to J2SE-1.5 by default?
- Difference in System. exit(0) , System.exit(-1), System.exit(1 ) in Java
- Exception in thread “main” java.lang.UnsupportedClassVersionError: a (Unsupported major.minor version 51.0)
- How to compare two double values in Java?
- package does not exist error!
- Required: Variable Found: Value
- What does the colon (:) operator do?
- Missing method body, or declare abstract in Java
- java code is showing error. ( ‘;’,expected) [closed]
- How can I edit a .jar file?
- java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver Exception occurring. Why?
- JAVA_HOME should point to a JDK not a JRE
- This Activity already has an action bar supplied by the window decor?
- Convert hex string to int
- Orphaned Case Error in Java
- Regular Expressions on Punctuation
- How to make a countdown timer in Java
- (Java) Tic-Tac-Toe game using 2 dimensional Array
- Incompatible types List of List and ArrayList of ArrayList
- Dice Rolling java program
- Why use getters and setters/accessors?
- How to use a Do-while loop that continuously prompts a user?
- Java equivalent of unsigned long long?
- Getting “unixtime” in Java
- How do I break out of nested loops in Java?
- How do I convert this for loop into a while loop?
- What’s so special about 0x7f?
- Append a single character to a string or char array in java?
- Preventing a Java class from being instantiated and inherited
- Collision Detection between two images in Java
- What does .pack() do?
- String is immutable. What exactly is the meaning?
- How do I autoindent in Netbeans?
- What is an attribute in Java?