Common Hibernate Exceptions

BeanCreationException / Injection of autowired dependencies failed
Solution:
Add @Component and @Autowired annotation 
Java Class:
@Component
public class TestValidator implements Validator{}
 
Controller:
@Autowired
TestValidator
testValidator ;

 

Node to traverse cannot be null!
Solution:
This can be due to syntax error in query
1) missing comma b/w 2 columns
2) ordering in prepared statement


org.springframework.beans.NotReadablePropertyException: Invalid property
Solution:
Setter Getter not present.


SQLGrammarException / ORA-00904: "column_name": invalid identifier
Solution:
This means table or column does not exist.


org.hibernate.HibernateException: No Session found for current thread
Solution:
add @Transactional in serviceImpl


batch update returned unexpected row count from update 0 actual row count 0 expected 1
Solution:
Some error in id property


java.io.FileNotFoundException: (The system cannot find the path specified)
Check whether the folder you want exist. Check by manually creating the folder.

No comments:

Post a Comment