Closed
Description
There is an error what throwing NoSuchFieldException
when declare private
access modifier on getter method
.
Error
WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customGraphqlExecutor' defined in file [E:\core\core\build\classes\java\main\com\mbanq\graphql\CustomGraphqlExecutor.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphQLSchemaFactoryBean' defined in class path resource [com/introproventures/graphql/jpa/query/autoconfigure/GraphQLSchemaAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.introproventures.graphql.jpa.query.autoconfigure.GraphQLSchemaFactoryBean]: Factory method 'graphQLSchemaFactoryBean' threw exception; nested exception is java.lang.RuntimeException: java.lang.NoSuchFieldException: age
INFO o.s.o.j.LocalContainerEntityManagerFactoryBean Closing JPA EntityManagerFactory for persistence unit 'jpa-pu'
Aug 29, 2019 10:44:41 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service [Tomcat]
Example of Code
public class Student{
@Temporal(TemporalType.DATE)
@Column(name = "DOB")
private Date DateOfBirth;
@Column(name ="age")
private Integer age;
private Integer getAge(){
return Period.between(LocalDate.now(), dob).getYears();
}
}
Metadata
Metadata
Assignees
Labels
No labels