Skip to content

Use api, application-level service discovery model startup error #7351

@xiaoheng1

Description

@xiaoheng1
  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: dubbo2.7.9
  • Operating System version: macos
  • Java version: 1.8

Steps to reproduce this issue

private static void startWithBootstrap() {
        ServiceConfig<DemoServiceImpl> service = new ServiceConfig<>();
        service.setInterface(DemoService.class);
        service.setRef(new DemoServiceImpl());

        DubboBootstrap bootstrap = DubboBootstrap.getInstance();
        bootstrap.application(new ApplicationConfig("dubbo-demo-api-provider"))
                .registry(new RegistryConfig("zookeeper://127.0.0.1:2181?registry-type=service"))
                .service(service)
                .start()
                .await();
    }

Expected Result

start successful

Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

Exception in thread "main" java.lang.NullPointerException
	at org.apache.dubbo.registry.client.metadata.store.InMemoryWritableMetadataService.exportURL(InMemoryWritableMetadataService.java:129)
	at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.doRegister(ServiceDiscoveryRegistry.java:213)
	at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.register(ServiceDiscoveryRegistry.java:205)
	at org.apache.dubbo.registry.ListenerRegistryWrapper.register(ListenerRegistryWrapper.java:57)
	at org.apache.dubbo.registry.integration.RegistryProtocol.register(RegistryProtocol.java:181)
	at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:217)
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:62)
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:72)
	at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java)
	at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:494)
	at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:327)
	at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:302)
	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:203)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.lambda$exportServices$14(DubboBootstrap.java:1094)
	at java.util.HashMap$Values.forEach(HashMap.java:981)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.exportServices(DubboBootstrap.java:1081)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:895)
	at org.apache.dubbo.demo.provider.Application.startWithBootstrap(Application.java:49)
	at org.apache.dubbo.demo.provider.Application.main(Application.java:32)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions