在命令行下,java -Xmx6g -jar ./build/libs/tabby-1.1.1.RELEASE.jar没问题。
但在IDEA开发环境下,运行APP或Test都会报一个SpringBoot的错误,报错信息提示在下面函数增加@param选项,但还是没法解决。
java.lang.IllegalStateException: Failed to execute CommandLineRunner
For queries with named parameters you need to use provide names for method parameters. Use @Param for query method parameters, or when on Java 8+ use the javac flag -parameters.
public MethodReference getMethodRefBySignature(String signature){
return methodRepository.findMethodReferenceBySignature(signature);
}
java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:822) [spring-boot-2.4.5.jar:2.4.5]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:803) [spring-boot-2.4.5.jar:2.4.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:346) [spring-boot-2.4.5.jar:2.4.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1340) [spring-boot-2.4.5.jar:2.4.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1329) [spring-boot-2.4.5.jar:2.4.5]
at tabby.App.main(App.java:36) [classes/:na]
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: **For queries with named parameters you need to use provide names for method parameters. Use @Param for query method parameters, or when on Java 8+ use the javac flag -parameters.;** nested exception is java.lang.IllegalStateException: For queries with named parameters you need to use provide names for method parameters. Use @Param for query method parameters, or when on Java 8+ use the javac flag -parameters.
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:371) ~[spring-orm-5.3.6.jar:5.3.6]
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:235) ~[spring-orm-5.3.6.jar:5.3.6]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:551) ~[spring-orm-5.3.6.jar:5.3.6]
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61) ~[spring-tx-5.3.6.jar:5.3.6]
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242) ~[spring-tx-5.3.6.jar:5.3.6]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:152) ~[spring-tx-5.3.6.jar:5.3.6]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.6.jar:5.3.6]
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:145) ~[spring-data-jpa-2.4.8.jar:2.4.8]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.6.jar:5.3.6]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.6.jar:5.3.6]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.6.jar:5.3.6]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) ~[spring-aop-5.3.6.jar:5.3.6]
at com.sun.proxy.$Proxy90.findMethodReferenceBySignature(Unknown Source) ~[na:na]
at tabby.dal.caching.service.MethodRefService.getMethodRefBySignature(MethodRefService.java:24) ~[classes/:na]
at tabby.core.container.DataContainer.getMethodRefBySubSignature(DataContainer.java:172) ~[classes/:na]
at tabby.core.container.DataContainer.getAliasMethodRefs(DataContainer.java:335) ~[classes/:na]
at tabby.core.scanner.ClassInfoScanner.makeAliasRelation(ClassInfoScanner.java:203) ~[classes/:na]
at tabby.core.scanner.ClassInfoScanner.makeAliasRelations(ClassInfoScanner.java:183) ~[classes/:na]
at tabby.core.scanner.ClassInfoScanner.extractRelationships(ClassInfoScanner.java:137) ~[classes/:na]
at tabby.core.scanner.ClassInfoScanner.buildClassEdges(ClassInfoScanner.java:102) ~[classes/:na]
at tabby.core.scanner.ClassInfoScanner.run(ClassInfoScanner.java:44) ~[classes/:na]
at tabby.core.Analyser.runSootAnalysis(Analyser.java:107) ~[classes/:na]
at tabby.core.Analyser.run(Analyser.java:81) ~[classes/:na]
at tabby.App.lambda$run$0(App.java:89) [classes/:na]
在命令行下,java -Xmx6g -jar ./build/libs/tabby-1.1.1.RELEASE.jar没问题。 但在IDEA开发环境下,运行APP或Test都会报一个SpringBoot的错误,报错信息提示在下面函数增加@param选项,但还是没法解决。 java.lang.IllegalStateException: Failed to execute CommandLineRunner For queries with named parameters you need to use provide names for method parameters. Use @Param for query method parameters, or when on Java 8+ use the javac flag -parameters.
报错信息如下,更换过java版本(jdk1.8.0_342/1.8.0_341/1.8.0_352),都是一样的情况; 更换OS(win10/ubuntu22)也是同样的情况。