Hej,我正在用 kotlin 构建一个 Spring Boot 应用程序,并想使用内联类。我做了一个 spring 数据存储库,它有一个方法如下:
fun getBy(name: GameName)
其中 GameName 是一个内联类
inline class GameName(val value: String)
一切都在本地运行,我正在运行 jdk 1.8.0_181-b13。但是当我将它部署到谷歌云时,spring boot 应用程序没有启动。谷歌云似乎正在运行 openjdk 1.8.0_181。
当我在本地反编译代码时,它看起来像这样:
public GameConfigurationEntity getBy_00UsoVY/* $FF was: getBy-00UsoVY*/(@NotNull String gameName, @NotNull UUID id) { ... }
但是在谷歌云上我收到以下错误:
Caused by: java.lang.ClassFormatError: Illegal method name "getByName-MZoZWhM"
因此,它似乎在本地使用,_而在谷歌云上使用,-并且-在方法名称中不是有效字符。
其他人有这个吗?
完整的堆栈跟踪:
[INFO] GCLOUD: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gameConfigurationService' defined in URL [jar:file:/app.jar!/BOOT-INF/classes!/com/hexigames/configurationservice/domain/game/GameConfigurationService.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.hexigames.configurationservice.domain.game.GameConfigurationService: Common causes of this problem include using a final class or a non-visible class; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
[INFO] GCLOUD: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:581) ~[spring-beans-5.0.10.RELEASE.jar!/:5.0.10.RELEASE]
[INFO] GCLOUD: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.10.RELEASE.jar!/:5.0.10.RELEASE]
[INFO] GCLOUD: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.10.RELEASE.jar!/:5.0.10.RELEASE]
jeck猫
侃侃无极
相关分类