dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

[Bug] ConfigurableMetadataServiceExporter.export cause IndexOutOfBoundsException

Open ilaotan opened this issue 1 year ago • 1 comments

Pre-check

  • [X] I am sure that all the content I provide is in English.

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

3.2.15

Steps to reproduce this issue

When dubbo.provider.export=false is set, the project will report an error when starting up, but it does not affect the project running.

2024-09-09 10:42:10,455 [ERROR] [main] [] [] [] [] org.apache.dubbo.config.deploy.DefaultApplicationDeployer [? : ?]  [DUBBO] Dubbo Application[1.1](xxxxxxx) an exception occurred when handle starting event, dubbo version: 3.2.15, current host: 172.32.5.183, error code: 5-14. This may be caused by , go to https://dubbo.apache.org/faq/5/14 to find instructions. 
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:659)
	at java.util.ArrayList.get(ArrayList.java:435)
	at org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter.export(ConfigurableMetadataServiceExporter.java:78)
	at org.apache.dubbo.config.metadata.ExporterDeployListener.onModuleStarted(ExporterDeployListener.java:85)
	at org.apache.dubbo.config.deploy.DefaultApplicationDeployer.exportMetadataService(DefaultApplicationDeployer.java:1266)
	at org.apache.dubbo.config.deploy.DefaultApplicationDeployer.prepareApplicationInstance(DefaultApplicationDeployer.java:767)
	at org.apache.dubbo.config.deploy.DefaultApplicationDeployer.checkState(DefaultApplicationDeployer.java:1152)
	at org.apache.dubbo.config.deploy.DefaultApplicationDeployer.notifyModuleChanged(DefaultApplicationDeployer.java:1140)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.onModuleStarted(DefaultModuleDeployer.java:363)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:188)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:156)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:157)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:143)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:429)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:386)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:949)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:594)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:164)

What you expected to happen

If "dubbo.provider.export=false", then this "ExporterDeployListener.onModuleStarted" should not be called, right?

Anything else

the project params:

dubbo.protocol.name=dubbo dubbo.protocol.serialization=hessian2 dubbo.protocol.port=27001 dubbo.protocol.threads=220

dubbo.application.name=xxxx-dubbo-server-${spring.application.name} dubbo.application.register-mode=instance dubbo.application.metadata-service-protocol=dubbo dubbo.application.protocol=dubbo

dubbo.provider.export=false dubbo.provider.token=true

dubbo.registry.protocol=zookeeper dubbo.registry.address=${zookeeper.address} dubbo.registry.file=/root/.dubbo/${spring.application.name} dubbo.registry.use-as-config-center=true dubbo.registry.use-as-metadata-center=true

Are you willing to submit a pull request to fix on your own?

  • [ ] Yes I am willing to submit a pull request on my own!

Code of Conduct

ilaotan avatar Sep 09 '24 02:09 ilaotan

You can use Dubbo 3.3, which already solves this problem

heliang666s avatar Sep 09 '24 04:09 heliang666s