apache / dubbo-samples

samples for Apache Dubbo
Apache License 2.0
2.25k stars 1.92k forks source link

something was wrong while running ubbo-samples-master/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer #1017

Closed imgoby closed 10 months ago

imgoby commented 11 months ago

The Exception looks like this:

ns.factory.support.DefaultListableBeanFactory@592165dc, dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.390+08:00  WARN [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.s.r.ReferenceBeanManager         :  [DUBBO] Early initialize reference bean before DubboConfigBeanInitializer, the BeanPostProcessor has not been loaded at this time, which may cause abnormalities in some components (such as seata): demoService = ReferenceBean:org.apache.dubbo.nativeimage.DemoService(), dubbo version: 3.3.0-beta.1, current host: 192.168.0.219, error code: 5-39. This may be caused by , go to https://dubbo.apache.org/faq/5/39 to find instructions. 
2023-11-15T10:48:26.391+08:00 ERROR [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.dubbo.config.spring.ReferenceBean    :  [DUBBO] Failed to generate proxy by Javassist failed. Fallback to use JDK proxy success. Interfaces: [interface org.apache.dubbo.nativeimage.DemoService, interface org.apache.dubbo.rpc.service.EchoService, interface org.apache.dubbo.rpc.service.Destroyable], dubbo version: 3.3.0-beta.1, current host: 192.168.0.219, error code: 3-8. This may be caused by , go to https://dubbo.apache.org/faq/3/8 to find instructions. 

java.lang.RuntimeException: org.apache.dubbo.common.bytecode.ClassGenerator$DC
    at org.apache.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:362)
    at org.apache.dubbo.common.bytecode.Proxy.buildProxyClass(Proxy.java:171)
    at org.apache.dubbo.common.bytecode.Proxy.getProxy(Proxy.java:87)
    at org.apache.dubbo.config.spring.ReferenceBean.generateFromJavassistFirst(ReferenceBean.java:372)
    at org.apache.dubbo.config.spring.ReferenceBean.createLazyProxy(ReferenceBean.java:362)
    at org.apache.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:206)
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:148)
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:90)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1823)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getObjectForBeanInstance(AbstractAutowireCapableBeanFactory.java:1273)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:336)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
    at org.apache.dubbo.config.spring6.beans.factory.aot.ReferencedFieldValueResolver.resolveValue(ReferencedFieldValueResolver.java:195)
    at org.apache.dubbo.config.spring6.beans.factory.aot.ReferencedFieldValueResolver.resolveAndSet(ReferencedFieldValueResolver.java:172)
    at org.apache.dubbo.nativeimage.consumer.NativeDemoConsumerApplication__DubboReference.apply(NativeDemoConsumerApplication__DubboReference.java:15)
    at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:83)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:947)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:310)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293)
    at org.apache.dubbo.nativeimage.consumer.NativeDemoConsumerApplication.main(NativeDemoConsumerApplication.java:38)
    at java.base@21/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: javassist.NotFoundException: org.apache.dubbo.common.bytecode.ClassGenerator$DC
    at javassist.ClassPool.get(ClassPool.java:430)
    at org.apache.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:314)
    ... 34 common frames omitted

2023-11-15T10:48:26.405+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.s.c.DubboConfigBeanInitializer   :  [DUBBO] loading dubbo config beans ..., dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.405+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.s.c.DubboConfigBeanInitializer   :  [DUBBO] dubbo config beans are loaded., dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.408+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.s.reference.ReferenceCreator     :  [DUBBO] The configBean[type:ReferenceConfig<org.apache.dubbo.nativeimage.DemoService>] has been built., dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.493+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.utils.ConfigValidationUtils      :  [DUBBO] QosProtocolWrapper not found, qos will not be enabled, please check if 'dubbo-qos' dependency was imported correctly., dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.495+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.dubbo.config.context.ConfigManager   :  [DUBBO] The current configurations or effective configurations are as follows:, dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.495+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.dubbo.config.context.ConfigManager   :  [DUBBO] <dubbo:application compiler="jdk" enableFileCache="true" logger="slf4j" qosPort="22223" executorManagementMode="isolation" parameters="{}" name="dubbo-samples-nativeimage-consumer" protocol="dubbo" />, dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.495+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.dubbo.config.context.ConfigManager   :  [DUBBO] <dubbo:protocol preferSerialization="fastjson2,hessian2" name="dubbo" />, dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.495+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.dubbo.config.context.ConfigManager   :  [DUBBO] <dubbo:ssl />, dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.511+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.deploy.DefaultModuleDeployer     :  [DUBBO] Dubbo Module[1.1.0] has been initialized!, dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.517+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.deploy.DefaultModuleDeployer     :  [DUBBO] Dubbo Module[1.1.1] has been initialized!, dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.519+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.d.DefaultApplicationDeployer     :  [DUBBO] Dubbo Application[1.1](dubbo-samples-nativeimage-consumer) has been initialized!, dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.520+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.deploy.DefaultModuleDeployer     :  [DUBBO] Dubbo Module[1.1.1] is starting., dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.520+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.d.DefaultApplicationDeployer     :  [DUBBO] Dubbo Application[1.1](dubbo-samples-nativeimage-consumer) is starting., dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.520+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.deploy.DefaultModuleDeployer     :  [DUBBO] Dubbo Module[1.1.0] is starting., dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.520+08:00  INFO [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.deploy.DefaultModuleDeployer     :  [DUBBO] Dubbo Module[1.1.0] has started., dubbo version: 3.3.0-beta.1, current host: 192.168.0.219
2023-11-15T10:48:26.520+08:00 ERROR [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.deploy.DefaultModuleDeployer     :  [DUBBO] Model reference failed: Dubbo Module[1.1.1] , catch error : No such any registry to reference org.apache.dubbo.nativeimage.DemoService on the consumer 192.168.0.219 use dubbo version 3.3.0-beta.1, please config <dubbo:registry address="..." /> to your spring config., dubbo version: 3.3.0-beta.1, current host: 192.168.0.219, error code: 5-15. This may be caused by , go to https://dubbo.apache.org/faq/5/15 to find instructions. 

java.lang.IllegalStateException: No such any registry to reference org.apache.dubbo.nativeimage.DemoService on the consumer 192.168.0.219 use dubbo version 3.3.0-beta.1, please config <dubbo:registry address="..." /> to your spring config.
    at org.apache.dubbo.config.ReferenceConfig.aggregateUrlFromRegistry(ReferenceConfig.java:608)
    at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:465)
    at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:354)
    at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:239)
    at org.apache.dubbo.config.utils.SimpleReferenceCache.get(SimpleReferenceCache.java:132)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:502)
    at java.base@21/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4783)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:482)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:179)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:151)
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:155)
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:141)
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:413)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:370)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:937)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:587)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:310)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293)
    at org.apache.dubbo.nativeimage.consumer.NativeDemoConsumerApplication.main(NativeDemoConsumerApplication.java:38)
    at java.base@21/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)

2023-11-15T10:48:26.521+08:00 ERROR [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.deploy.DefaultModuleDeployer     :  [DUBBO] Model start failed: Dubbo Module[1.1.1] start failed: java.lang.IllegalStateException: No such any registry to reference org.apache.dubbo.nativeimage.DemoService on the consumer 192.168.0.219 use dubbo version 3.3.0-beta.1, please config <dubbo:registry address="..." /> to your spring config., dubbo version: 3.3.0-beta.1, current host: 192.168.0.219, error code: 5-14. This may be caused by , go to https://dubbo.apache.org/faq/5/14 to find instructions. 

java.lang.IllegalStateException: No such any registry to reference org.apache.dubbo.nativeimage.DemoService on the consumer 192.168.0.219 use dubbo version 3.3.0-beta.1, please config <dubbo:registry address="..." /> to your spring config.
    at org.apache.dubbo.config.ReferenceConfig.aggregateUrlFromRegistry(ReferenceConfig.java:608)
    at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:465)
    at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:354)
    at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:239)
    at org.apache.dubbo.config.ReferenceConfigBase.get(ReferenceConfigBase.java:379)
    at org.apache.dubbo.config.utils.SimpleReferenceCache.destroyReference(SimpleReferenceCache.java:288)
    at org.apache.dubbo.config.utils.SimpleReferenceCache.destroy(SimpleReferenceCache.java:241)
    at org.apache.dubbo.config.utils.SimpleReferenceCache.destroy(SimpleReferenceCache.java:265)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:507)
    at java.base@21/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4783)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:482)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:179)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:151)
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:155)
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:141)
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:413)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:370)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:937)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:587)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:310)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293)
    at org.apache.dubbo.nativeimage.consumer.NativeDemoConsumerApplication.main(NativeDemoConsumerApplication.java:38)
    at java.base@21/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)

2023-11-15T10:48:26.521+08:00 ERROR [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.a.d.c.d.DefaultApplicationDeployer     :  [DUBBO] Dubbo Application[1.1](dubbo-samples-nativeimage-consumer) found failed module: Dubbo Module[1.1.1], dubbo version: 3.3.0-beta.1, current host: 192.168.0.219, error code: 5-14. This may be caused by , go to https://dubbo.apache.org/faq/5/14 to find instructions. 

java.lang.IllegalStateException: No such any registry to reference org.apache.dubbo.nativeimage.DemoService on the consumer 192.168.0.219 use dubbo version 3.3.0-beta.1, please config <dubbo:registry address="..." /> to your spring config.
    at org.apache.dubbo.config.ReferenceConfig.aggregateUrlFromRegistry(ReferenceConfig.java:608)
    at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:465)
    at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:354)
    at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:239)
    at org.apache.dubbo.config.ReferenceConfigBase.get(ReferenceConfigBase.java:379)
    at org.apache.dubbo.config.utils.SimpleReferenceCache.destroyReference(SimpleReferenceCache.java:288)
    at org.apache.dubbo.config.utils.SimpleReferenceCache.destroy(SimpleReferenceCache.java:241)
    at org.apache.dubbo.config.utils.SimpleReferenceCache.destroy(SimpleReferenceCache.java:265)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:507)
    at java.base@21/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4783)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:482)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:179)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:151)
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:155)
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:141)
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:413)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:370)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:937)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:587)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:310)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293)
    at org.apache.dubbo.nativeimage.consumer.NativeDemoConsumerApplication.main(NativeDemoConsumerApplication.java:38)
    at java.base@21/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)

2023-11-15T10:48:26.534+08:00 ERROR [dubbo-samples-nativeimage-consumer,,] 10098 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalStateException: No such any registry to reference org.apache.dubbo.nativeimage.DemoService on the consumer 192.168.0.219 use dubbo version 3.3.0-beta.1, please config <dubbo:registry address="..." /> to your spring config.
    at org.apache.dubbo.config.ReferenceConfig.aggregateUrlFromRegistry(ReferenceConfig.java:608)
    at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:465)
    at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:354)
    at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:239)
    at org.apache.dubbo.config.ReferenceConfigBase.get(ReferenceConfigBase.java:379)
    at org.apache.dubbo.config.utils.SimpleReferenceCache.destroyReference(SimpleReferenceCache.java:288)
    at org.apache.dubbo.config.utils.SimpleReferenceCache.destroy(SimpleReferenceCache.java:241)
    at org.apache.dubbo.config.utils.SimpleReferenceCache.destroy(SimpleReferenceCache.java:265)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:507)
    at java.base@21/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4783)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:482)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:179)
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:151)
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:155)
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:141)
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:413)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:370)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:937)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:587)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:310)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293)
    at org.apache.dubbo.nativeimage.consumer.NativeDemoConsumerApplication.main(NativeDemoConsumerApplication.java:38)
    at java.base@21/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
imgoby commented 11 months ago

step is :

  1. mvn clean install -P native native:compile -Dmaven.test.skip=true
  2. cd dubbo-samples-master/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/target
  3. ./dubbo-samples-native-image-consumer

image

@CrazyHZM Do you know why?

CrazyHZM commented 11 months ago

@imgoby Failed to generate proxy by Javassist failed. Fallback to use JDK proxy success. Interfaces This error should not affect you. We will consider how to avoid this error message.

FoghostCn commented 11 months ago

please assign to me

FoghostCn commented 11 months ago

@CrazyHZM I found that ReferenceAnnotationBeanPostProcessor will not work in native scenario, because AotWithSpringDetector.useGeneratedArtifacts() = true, the processor is not registered

https://github.com/apache/dubbo/blob/0c766ad4628aae9f51f28c7af2da66a5690ef6c0/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboSpringInitializer.java#L148-L151

finally ReferenceConfig.url is not set correctly, and get the error, I'm not sure how to fix it

ERROR [dubbo-samples-nativeimage-consumer,,] 17013 --- [           main] o.a.d.c.deploy.DefaultModuleDeployer     :  [DUBBO] Model reference failed: Dubbo Module[1.1.1] , catch error : No such any registry to reference org.apache.dubbo.nativeimage.DemoService on the consumer 10.253.77.49 use dubbo version 3.3.0-beta.2-SNAPSHOT, please config <dubbo:registry address="..." /> to your spring config., dubbo version: 3.3.0-beta.2-SNAPSHOT, current host: 10.253.77.49, error code: 5-15. This may be caused by , go to https://dubbo.apache.org/faq/5/15 to find instructions. 

java.lang.IllegalStateException: No such any registry to reference org.apache.dubbo.nativeimage.DemoService on the consumer 10.253.77.49 use dubbo version 3.3.0-beta.2-SNAPSHOT, please config <dubbo:registry address="..." /> to your spring config.
        at org.apache.dubbo.config.ReferenceConfig.aggregateUrlFromRegistry(ReferenceConfig.java:647) ~[dubbo-samples-native-image-consumer:3.3.0-beta.2-SNAPSHOT]
        at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:487) ~[dubbo-samples-native-image-consumer:3.3.0-beta.2-SNAPSHOT]
        at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:372) ~[dubbo-samples-native-image-consumer:3.3.0-beta.2-SNAPSHOT]
        at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:241) ~[dubbo-samples-native-image-consumer:3.3.0-beta.2-SNAPSHOT]
        at org.apache.dubbo.config.utils.SimpleReferenceCache.get(SimpleReferenceCache.java:140) ~[na:na]
        at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:564) ~[dubbo-samples-native-image-consumer:3.3.0-beta.2-SNAPSHOT]
        at java.base@17.0.6/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4780) ~[na:na]
        at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:536) ~[dubbo-samples-native-image-consumer:3.3.0-beta.2-SNAPSHOT]
        at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:186) ~[dubbo-samples-native-image-consumer:3.3.0-beta.2-SNAPSHOT]
        at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:159) ~[dubbo-samples-native-image-consumer:3.3.0-beta.2-SNAPSHOT]
        at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:167) ~[dubbo-samples-native-image-consumer:na]
        at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:153) ~[dubbo-samples-native-image-consumer:na]
        at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52) ~[dubbo-samples-native-image-consumer:na]
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[na:na]
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[na:na]
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[na:na]
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:413) ~[dubbo-samples-native-image-consumer:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:370) ~[dubbo-samples-native-image-consumer:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:937) ~[dubbo-samples-native-image-consumer:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:587) ~[dubbo-samples-native-image-consumer:6.0.7]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[dubbo-samples-native-image-consumer:3.0.5]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[dubbo-samples-native-image-consumer:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[dubbo-samples-native-image-consumer:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304) ~[dubbo-samples-native-image-consumer:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293) ~[dubbo-samples-native-image-consumer:3.0.5]
        at org.apache.dubbo.nativeimage.consumer.NativeDemoConsumerApplication.main(NativeDemoConsumerApplication.java:38) ~[dubbo-samples-native-image-consumer:na]
CrazyHZM commented 11 months ago

@FoghostCn ReferenceAnnotationBeanPostProcessor will be replaced with ReferenceAnnotationWithAotBeanPostProcessor in the native scenario.

FoghostCn commented 11 months ago

@FoghostCn

ReferenceAnnotationBeanPostProcessor will be replaced with ReferenceAnnotationWithAotBeanPostProcessor in the native scenario.

Yes but ReferenceAnnotationWithAotBeanPostProcessor is not register too

if (!AotWithSpringDetector.useGeneratedArtifacts()) { // false in native scenario
    DubboBeanUtils.registerCommonBeans(registry); // not reachable, AotBeanPostProcessor is register here
}
CrazyHZM commented 10 months ago

This is because BeanDefinition does not pass attributes by default in native. It will be fixed in the next version.