You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/03/19 06:05:30 UTC

[GitHub] [dubbo] zhanjinhao opened a new issue #9808: exception occurred in generic provider impl

zhanjinhao opened a new issue #9808:
URL: https://github.com/apache/dubbo/issues/9808


   I have code following about generic provider impl:
   
   ``` java
   package ap;
   
   import org.apache.dubbo.config.*;
   import org.apache.dubbo.config.bootstrap.DubboBootstrap;
   import org.apache.dubbo.rpc.service.GenericService;
   
   /**
    * @Author ISJINHAO
    * @Date 2022/3/11 16:45
    */
   public class ApiGenericProvider {
   
       public static void main(String[] args) {
           ApplicationConfig applicationConfig = new ApplicationConfig();
           applicationConfig.setName("api-generic-provider");
           applicationConfig.setQosEnable(false);
   
           RegistryConfig registryConfig = new RegistryConfig();
           registryConfig.setAddress("zookeeper://127.0.0.1:2181");
           registryConfig.setTimeout(30000);
           registryConfig.setUseAsConfigCenter(false);
           registryConfig.setUseAsMetadataCenter(false);
   
           ProviderConfig providerConfig = new ProviderConfig();
           providerConfig.setRetries(3);
           providerConfig.setTimeout(3000);
   
           // 服务提供者协议配置
           ProtocolConfig protocol = new ProtocolConfig();
           protocol.setName("dubbo");
           protocol.setPort(12347);
           protocol.setThreads(4);
   
   
           // 注意:ServiceConfig为重对象,内部封装了与注册中心的连接,以及开启服务端口
           // 服务提供者暴露服务配置
           ServiceConfig<GenericService> echoServiceConfig = new ServiceConfig<>();
           echoServiceConfig.setInterface("esg.EchoService");
           echoServiceConfig.setRef(new EchoGenericService());
           echoServiceConfig.setVersion("1.0.0");
           echoServiceConfig.setProtocol(protocol);
           echoServiceConfig.setGeneric("true");
   
           // 通过DubboBootstrap简化配置组装,控制启动过程
           DubboBootstrap.getInstance()
                   .application(applicationConfig)         // 应用配置
                   .registry(registryConfig)               // 注册中心配置
                   .provider(providerConfig)
                   .protocol(protocol)                     // 全局默认协议配置
                   .service(echoServiceConfig)             // 添加ServiceConfig
                   .start()                                // 启动Dubbo
                   .await();                               // 挂起等待(防止进程退出)
       }
   }
   
   ```
   
   when i start the application, exception occurred
   
   ```
   [AppLog] 2022-03-19 13:59:18    [DUBBO] publishProvider getServiceDescriptor error. providerUrl: dubbo://192.168.43.11:12347/esg.EchoService?anyhost=true&application=api-generic-provider&deprecated=false&dubbo=2.0.2&dynamic=true&generic=true&interface=esg.EchoService&methods=*&qos.enable=false&release=2.7.15&retries=3&service.name=ServiceBean:/esg.EchoService:1.0.0&side=provider&threads=4&timeout=3000&version=1.0.0, dubbo version: 2.7.15, current host: 192.168.43.11 
   java.lang.ClassNotFoundException: esg.EchoService
   	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
   	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
   	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
   	at java.lang.Class.forName0(Native Method)
   	at java.lang.Class.forName(Class.java:264)
   	at org.apache.dubbo.registry.client.metadata.store.RemoteMetadataServiceImpl.publishProvider(RemoteMetadataServiceImpl.java:114)
   	at org.apache.dubbo.registry.client.metadata.store.RemoteMetadataServiceImpl.publishServiceDefinition(RemoteMetadataServiceImpl.java:98)
   	at org.apache.dubbo.registry.client.metadata.MetadataUtils.publishServiceDefinition(MetadataUtils.java:67)
   	at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:532)
   	at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:339)
   	at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:314)
   	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:238)
   	at org.apache.dubbo.config.bootstrap.DubboBootstrap.exportService(DubboBootstrap.java:1099)
   	at org.apache.dubbo.config.bootstrap.DubboBootstrap.lambda$exportServices$14(DubboBootstrap.java:1086)
   	at java.util.HashMap$Values.forEach(HashMap.java:981)
   	at org.apache.dubbo.config.bootstrap.DubboBootstrap.exportServices(DubboBootstrap.java:1070)
   	at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:886)
   	at ap.ApiGenericProvider.main(ApiGenericProvider.java:51)
   ```
   
   my env does not have class esg.EchoService, but i think the generic impl does not need  the interface existed in project.
   
   so how do i use the generic impl rightly? can somebody give me advice ?
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] chickenlj closed issue #9808: exception occurred in generic provider impl

Posted by GitBox <gi...@apache.org>.
chickenlj closed issue #9808:
URL: https://github.com/apache/dubbo/issues/9808


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zhanjinhao commented on issue #9808: exception occurred in generic provider impl

Posted by GitBox <gi...@apache.org>.
zhanjinhao commented on issue #9808:
URL: https://github.com/apache/dubbo/issues/9808#issuecomment-1074983981


   > Firstly, please notice that the error log above will not you Dubbo process from starting and working normally. It's just an error log.
   > 
   > We will try to optimize the metadata publish process and avoid class loading of generic services.
   
   thank you for your answer!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] chickenlj commented on issue #9808: exception occurred in generic provider impl

Posted by GitBox <gi...@apache.org>.
chickenlj commented on issue #9808:
URL: https://github.com/apache/dubbo/issues/9808#issuecomment-1074821773


   Firstly, please notice that the error log above will not you Dubbo process from starting and working normally. It's just an error log.
   
   We will try to optimize the metadata publish process and avoid class loading of generic services.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org