Quarkus native和org.kohsuke:解析过程中未解析的方法-@WithBridgeMethods注释的



Quarkus native and org.kohsuke:github-api-解析过程中未解析的方法-@WithBridgeMethods注释方法

这是Quarkus native和org.kohsuke:github-api的后续操作-无法反序列化异常问题,我正在使用https://github.com/quarkusio/quarkus/pull/9182用私有内部类GHRepository.GHRepoPermission.class克服寄存器反射挑战的补丁。

我不得不将GHLicense.class添加到@RegisterForReflection,现在我的示例应用程序在本机编译过程中失败了,它说:发现了未解析的方法

[getting-started-1.0-SNAPSHOT-runner:42440]     analysis:  60,222.05 ms,  6.04 GB
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: org.kohsuke.github.GHLicense.urlToString(java.net.URL, java.lang.Class). To diagnose the issue you can use the --allow-incomplete-classpath option. The missing method is then reported at run time when it is accessed the first time.
Detailed message:
Trace:
at parsing org.kohsuke.github.GHLicense.getUrl(GHLicense.java)
Call path from entry point to org.kohsuke.github.GHLicense.getUrl():
at org.kohsuke.github.GHLicense.getUrl(GHLicense.java)
at com.oracle.svm.reflect.GHObject_getUrl_d595a42af79d3a07fda24477277adddcaeacd46d_608.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:122)

https://github.com/hub4j/github-api/blob/master/src/main/java/org/kohsuke/github/GHLicense.java#L84getUrl((方法使用@WithBridgeMethods注释

@WithBridgeMethods(value = String.class, adapterMethod = "urlToString")
public URL getUrl() {
return GitHubClient.parseURL(url);
}

有什么解决办法吗?或者这纯粹是GraalVM的事情?

这纯粹是GraalVM问题,要解决它,唯一的方法(我知道除了在实际库中更改代码之外(是创建一个Quarkus扩展,它将替换库中有问题的部分。

更新

这个Quarkus扩展基本上使库在本机模式下正常工作,并且是Quarkus Bot应用程序的基础,该应用程序在Quarkus GitHub存储库上用于各种任务。

最新更新