-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] 2023.0.0.0-RC1 Not Supported graalvm #3656
Comments
Can you provide a demo reproduction? |
com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: CANCELLED: Failed to read message. ConfigChangeNotifyRequest { |
I use |
BTW, The examples provided by spring cloud alibaba are compiled and tested by graalvm native, you can refer to the code in the examples to run the. |
@yuluo-yx nacos-client-2.3.0.jar!\META-INF\native-image\com.alibaba.nacos\nacos-client\reflect-config.json {
"name":"com.alibaba.nacos.api.remote.request.ConnectionSetupRequest",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true,
"methods":[
{"name":"getAbilities","parameterTypes":[] },
{"name":"getClientVersion","parameterTypes":[] },
{"name":"getLabels","parameterTypes":[] },
{"name":"getTenant","parameterTypes":[] }
]
} Lack of methods ConnectionSetupRequest.getAbilityTable() config suggest: |
In this way, after modifying the code, reflect-config.json is also new |
@lmm1990 Could you please file a pull request to add the above item into reflect-config.json. Thanks. We will think of the auto-generated way later. |
fixed alibaba/nacos#11860 |
This issue has been open 30 days with no activity. This will be closed in 7 days. |
This issue has been automatically marked as stale because it hasn't had any recent activity.If you think this should still be open, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. Thank you for your interest and contribution to the Sping Cloud Alibaba Community. |
我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。另外请按照如下要求提交相关信息节省社区维护同学的理解成本,否则该讨论极有可能直接被忽视或关闭。
We recommend using English. If you are non-native English speaker, you can use the translation software. We recommend using English. If you are non-native English speaker, you can use the translation software. In addition, please submit relevant information according to the following requirements to save the understanding cost of community maintenances, otherwise the discussion is very likely to be ignored or closed directly.
Which Component
Nacos Discovery
Describe the bug
2024-03-14 14:27:13.669 WARN 1 --- [ main] com.alibaba.nacos.common.remote.client : [f47bcefe-8c4d-455d-a274-f4b023c06781] Fail to connect to server on start up, error message = The program tried to reflectively invoke method public java.util.Map com.alibaba.nacos.api.remote.request.ConnectionSetupRequest.getAbilityTable() without it being registered for runtime reflection. Add public java.util.Map com.alibaba.nacos.api.remote.request.ConnectionSetupRequest.getAbilityTable() to the reflection metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection for help., start up retry times left: 1
org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively invoke method public java.util.Map com.alibaba.nacos.api.remote.request.ConnectionSetupRequest.getAbilityTable() without it being registered for runtime reflection. Add public java.util.Map com.alibaba.nacos.api.remote.request.ConnectionSetupRequest.getAbilityTable() to the reflection metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection for help.
at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.MissingReflectionRegistrationUtils.forQueriedOnlyExecutable(MissingReflectionRegistrationUtils.java:72)
at java.base@21.0.1/java.lang.reflect.Method.acquireMethodAccessor(Method.java:77)
at java.base@21.0.1/java.lang.reflect.Method.invoke(Method.java:577)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:688)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:772)
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:479)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:318)
at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4719)
at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsBytes(ObjectMapper.java:3987)
at com.alibaba.nacos.common.utils.JacksonUtils.toJsonBytes(JacksonUtils.java:77)
at com.alibaba.nacos.common.remote.client.grpc.GrpcUtils.convertRequestToByte(GrpcUtils.java:106)
at com.alibaba.nacos.common.remote.client.grpc.GrpcUtils.convert(GrpcUtils.java:80)
at com.alibaba.nacos.common.remote.client.grpc.GrpcConnection.sendRequest(GrpcConnection.java:128)
at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.connectToServer(GrpcClient.java:404)
at com.alibaba.nacos.common.remote.client.RpcClient.start(RpcClient.java:352)
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.start(NamingGrpcClientProxy.java:117)
at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.(NamingGrpcClientProxy.java:110)
at com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate.(NamingClientProxyDelegate.java:79)
at com.alibaba.nacos.client.naming.NacosNamingService.init(NacosNamingService.java:103)
at com.alibaba.nacos.client.naming.NacosNamingService.(NacosNamingService.java:86)
at java.base@21.0.1/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at java.base@21.0.1/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
at com.alibaba.nacos.api.naming.NamingFactory.createNamingService(NamingFactory.java:59)
at com.alibaba.nacos.api.NacosFactory.createNamingService(NacosFactory.java:77)
at com.alibaba.cloud.nacos.NacosServiceManager.createNewNamingService(NacosServiceManager.java:99)
at com.alibaba.cloud.nacos.NacosServiceManager.buildNamingService(NacosServiceManager.java:90)
at com.alibaba.cloud.nacos.NacosServiceManager.getNamingService(NacosServiceManager.java:46)
at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.namingService(NacosServiceRegistry.java:193)
at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:68)
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.register(AbstractAutoServiceRegistration.java:264)
at com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration.register(NacosAutoServiceRegistration.java:78)
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.start(AbstractAutoServiceRegistration.java:156)
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:119)
at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:49)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:451)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:384)
at org.springframework.boot.web.reactive.context.WebServerManager.start(WebServerManager.java:57)
at org.springframework.boot.web.reactive.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:41)
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:288)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:471)
at java.base@21.0.1/java.lang.Iterable.forEach(Iterable.java:75)
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:260)
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:205)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:978)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627)
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
at cc.metafusion.ad_desk_api.Application.main(Application.java:10)
at java.base@21.0.1/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Simplest demo
build.gradle
To Reproduce
Steps to reproduce the behavior:
NotifySubscriberRequest
ConnectionSetupRequest
AbstractConfigRequest
Expected behavior
running success
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
os: centos8
graalvm: 21
proposal
reflect-config.json add
{
"name": "com.alibaba.nacos.api.naming.remote.request.NotifySubscriberRequest",
"allDeclaredFields": true,
"allDeclaredConstructors": true,
"methods": [
{
"name": "getGroupName",
"parameterTypes": [ ]
},
{
"name": "getModule",
"parameterTypes": [ ]
},
{
"name": "getNamespace",
"parameterTypes": [ ]
},
{
"name": "getServiceInfo",
"parameterTypes": [ ]
},
{
"name": "getServiceName",
"parameterTypes": [ ]
},
{
"name": "setGroupName",
"parameterTypes": [
"java.lang.String"
]
},
{
"name": "setNamespace",
"parameterTypes": [
"java.lang.String"
]
},
{
"name": "setServiceInfo",
"parameterTypes": [
"com.alibaba.nacos.api.naming.pojo.ServiceInfo"
]
},
{
"name": "setServiceName",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"name": "com.alibaba.nacos.api.remote.request.ConnectionSetupRequest",
"allDeclaredFields": true,
"allDeclaredConstructors": true,
"methods": [
{
"name": "getAbilityTable",
"parameterTypes": [ ]
},
{
"name": "getClientVersion",
"parameterTypes": [ ]
},
{
"name": "getLabels",
"parameterTypes": [ ]
},
{
"name": "getTenant",
"parameterTypes": [ ]
},
{
"name": "setAbilityTable",
"parameterTypes": [
"java.util.Map"
]
},
{
"name": "setClientVersion",
"parameterTypes": [
"java.lang.String"
]
},
{
"name": "setLabels",
"parameterTypes": [
"java.util.Map"
]
},
{
"name": "setTenant",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"name": "com.alibaba.nacos.api.config.remote.request.AbstractConfigRequest",
"allDeclaredFields": true,
"allDeclaredConstructors": true,
"methods": [
{
"name": "getDataId",
"parameterTypes": [ ]
},
{
"name": "getGroup",
"parameterTypes": [ ]
},
{
"name": "getModule",
"parameterTypes": [ ]
},
{
"name": "getTenant",
"parameterTypes": [ ]
},
{
"name": "setDataId",
"parameterTypes": [
"java.lang.String"
]
},
{
"name": "setGroup",
"parameterTypes": [
"java.lang.String"
]
},
{
"name": "setTenant",
"parameterTypes": [
"java.lang.String"
]
}
]
}
The text was updated successfully, but these errors were encountered: