Answer the question
In order to leave comments, you need to log in
What is the reason for the An attempt was made to call a method that does not exist error?
I'm trying to start a Spring Boot application and I get an error:
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:160)
The following method did not exist:
org.springframework.expression.spel.support.StandardTypeConverter.<init>(Ljava/util/function/Supplier;)V
The method's class, org.springframework.expression.spel.support.StandardTypeConverter, is available from the following locations:
jar:file:/C:/Users/n199a/.m2/repository/org/springframework/spring-expression/5.3.10/spring-expression-5.3.10.jar!/org/springframework/expression/spel/support/StandardTypeConverter.class
The class hierarchy was loaded from the following locations:
org.springframework.expression.spel.support.StandardTypeConverter: file:/C:/Users/n199a/.m2/repository/org/springframework/spring-expression/5.3.10/spring-expression-5.3.10.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.expression.spel.support.StandardTypeConverter
Process finished with exit code 1
@Profile("dev")
@Configuration
@EnableTransactionManagement
public class EsmConfiguration implements WebMvcConfigurer {
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(new StringToColumnNameConverter());
registry.addConverter(new StringToSqlSortOperatorConverter());
registry.addConverter(new StringToRequestParameterConverter());
}
}
public class StringToColumnNameConverter implements Converter<String, ColumnName> {
@Override
public ColumnName convert(@NotBlank String source) {
return ColumnName.valueOf(source.toUpperCase());
}
}
Answer the question
In order to leave comments, you need to log in
Found, in `pom.xml` there were inconsistencies in the versions of the connected libraries. I have had:
<dependency> <!-- For annotations -->
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.3.12</version>
</dependency>
<dependency> <!-- For annotations -->
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.3.10</version>
</dependency>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question