Tuesday, August 15, 2023

java: spring boot: How to search project issues in the stack trace

 

>PROBLEM

The application throws a lot of exceptions and you get confused to understand the cause because there are so many compiler complaints.


>SOLUTION

Follow by the example below.
If you go to the first compiler's complaint, you'll be mislead.

To find the real cause, the one that triggered the others, begin from the bottom to the top of the stack trace (the yellow in the example). 
The issue was caused for a field notation error. On the database the field is denoted by "pass" and not "password". Check the images at the bottom.


2023-08-15 09:37:23 # [restartedMain] # ERROR # o.s.boot.SpringApplication # method: reportFailure # Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appController': Unsatisfied dependency expressed through field 'wsSvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'wsSvcImpl': Unsatisfied dependency expressed through field 'encryptionSvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'encryptionSvc': Unsatisfied dependency expressed through field 'securitySvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securitySvc': Unsatisfied dependency expressed through field 'accControlSvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accControlSvc': Unsatisfied dependency expressed through field 'accControlRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accControlRepository' defined in com.drillback.setget5.model.repository.security.AccControlRepository defined in @EnableJpaRepositories declared on JpaConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)! Reason: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'wsSvcImpl': Unsatisfied dependency expressed through field 'encryptionSvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'encryptionSvc': Unsatisfied dependency expressed through field 'securitySvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securitySvc': Unsatisfied dependency expressed through field 'accControlSvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accControlSvc': Unsatisfied dependency expressed through field 'accControlRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accControlRepository' defined in com.drillback.setget5.model.repository.security.AccControlRepository defined in @EnableJpaRepositories declared on JpaConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)! Reason: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'encryptionSvc': Unsatisfied dependency expressed through field 'securitySvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securitySvc': Unsatisfied dependency expressed through field 'accControlSvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accControlSvc': Unsatisfied dependency expressed through field 'accControlRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accControlRepository' defined in com.drillback.setget5.model.repository.security.AccControlRepository defined in @EnableJpaRepositories declared on JpaConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)! Reason: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securitySvc': Unsatisfied dependency expressed through field 'accControlSvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accControlSvc': Unsatisfied dependency expressed through field 'accControlRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accControlRepository' defined in com.drillback.setget5.model.repository.security.AccControlRepository defined in @EnableJpaRepositories declared on JpaConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)! Reason: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accControlSvc': Unsatisfied dependency expressed through field 'accControlRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accControlRepository' defined in com.drillback.setget5.model.repository.security.AccControlRepository defined in @EnableJpaRepositories declared on JpaConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)! Reason: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accControlRepository' defined in com.drillback.setget5.model.repository.security.AccControlRepository defined in @EnableJpaRepositories declared on JpaConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)! Reason: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!

Caused by: org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)! Reason: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!

Caused by: java.lang.IllegalArgumentException: Validation failed for query for method public abstract com.drillback.setget5.model.repository.security.AccControl com.drillback.setget5.model.repository.security.AccControlRepository.findByEmailAndMsg(java.lang.String,java.lang.String)!

Caused by: java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: password of: com.drillback.setget5.model.repository.security.AccControl [from com.drillback.setget5.model.repository.security.AccControl ac where ac.email=:email and ac.password=:password]

Caused by: org.hibernate.QueryException: could not resolve property: password of: com.drillback.setget5.model.repository.security.AccControl [from com.drillback.setget5.model.repository.security.AccControl ac where ac.email=:email and ac.password=:password]

Caused by: org.hibernate.QueryException: could not resolve property: password of: com.drillback.setget5.model.repository.security.AccControl








>ENV

Java


No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...