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 2021/11/09 02:28:59 UTC

[GitHub] [dubbo] HaoLi-Rainbow opened a new issue #9238: dubbo 服务端应用 hutool 的 List> 之后启动报错

HaoLi-Rainbow opened a new issue #9238:
URL: https://github.com/apache/dubbo/issues/9238


   # dubbo 服务端应用 hutool 的 List<Tree<String>> 之后启动报错
   
   
   
   1. pom坐标
   
      ```xml        <!-- Dubbo Spring Boot Starter -->
              <dependency>
                  <groupId>org.springframework.boot</groupId>
                  <artifactId>spring-boot-starter</artifactId>
                  <version>2.3.5.RELEASE</version>
              </dependency>
      
              <dependency>
                  <groupId>cn.hutool</groupId>
                  <artifactId>hutool-all</artifactId>
                  <version>5.4.5</version>
              </dependency>
      
      		<!-- Dubbo Spring Boot Starter -->
              <dependency>
                  <groupId>org.apache.dubbo</groupId>
                  <artifactId>dubbo-spring-boot-starter</artifactId>
                  <version>2.7.9</version>
              </dependency>
      
              <dependency>
                  <groupId>org.apache.dubbo</groupId>
                  <artifactId>dubbo-registry-nacos</artifactId>
                  <version>2.7.9</version>
              </dependency>
              <!--End Dubbo-->
      ```
   
   2. 错误代码
   
      ```java
      package com.***.comn.service.budgetItem;
      
      import cn.hutool.core.lang.tree.Tree;
      
      import java.util.List;
      
      /**
       *
       * @author lihao3
       */
      public interface IFinanceBudgetItemSV {
      
        /**
         * 树形菜单
         *
         * @return
         */
        List<Tree<String>> selectTreeBudgetItems();
      
      }
      
      ```
   
      
   
   3. 异常信息
   
      ```java
      2021-10-28 11:27:38.538 ERROR 23176 --- [           main] o.s.boot.SpringApplication               : Application run failed
      
      java.lang.IllegalArgumentException: [ServiceDefinitionBuilder] Map type [cn.hutool.core.lang.tree.Tree<java.lang.String>] with unexpected amount of arguments [[Ljava.lang.reflect.Type;@7214e319].[class java.lang.String]
      	at org.apache.dubbo.metadata.definition.builder.MapTypeBuilder.build(MapTypeBuilder.java:56)
      	at org.apache.dubbo.metadata.definition.TypeDefinitionBuilder.build(TypeDefinitionBuilder.java:52)
      	at org.apache.dubbo.metadata.definition.builder.CollectionTypeBuilder.build(CollectionTypeBuilder.java:61)
      	at org.apache.dubbo.metadata.definition.TypeDefinitionBuilder.build(TypeDefinitionBuilder.java:52)
      	at org.apache.dubbo.metadata.definition.TypeDefinitionBuilder.build(TypeDefinitionBuilder.java:81)
      	at org.apache.dubbo.metadata.definition.ServiceDefinitionBuilder.build(ServiceDefinitionBuilder.java:83)
      	at org.apache.dubbo.metadata.definition.ServiceDefinitionBuilder.build(ServiceDefinitionBuilder.java:44)
      	at org.apache.dubbo.registry.client.metadata.store.InMemoryWritableMetadataService.publishServiceDefinition(InMemoryWritableMetadataService.java:175)
      	at org.apache.dubbo.registry.client.metadata.MetadataUtils.publishServiceDefinition(MetadataUtils.java:66)
      	at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:512)
      	at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:331)
      	at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:306)
      	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:207)
      	at org.apache.dubbo.config.bootstrap.DubboBootstrap.lambda$exportServices$14(DubboBootstrap.java:1095)
      	at org.apache.dubbo.config.bootstrap.DubboBootstrap$$Lambda$1318/0x0000000000000000.accept(Unknown Source)
      	at java.util.HashMap$Values.forEach(HashMap.java:981)
      	at org.apache.dubbo.config.bootstrap.DubboBootstrap.exportServices(DubboBootstrap.java:1082)
      	at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:896)
      	at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onContextRefreshedEvent(DubboBootstrapApplicationListener.java:62)
      	at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onApplicationContextEvent(DubboBootstrapApplicationListener.java:55)
      	at com.alibaba.spring.context.OnceApplicationContextEventListener.onApplicationEvent(OnceApplicationContextEventListener.java:52)
      	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
      	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
      	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
      	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404)
      	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361)
      	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:898)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554)
      	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
      	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
      	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
      	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
      	at com.wison.comn.ComnWebApplication.main(ComnWebApplication.java:16)
      
      2021-10-28 11:27:40.281  INFO 23176 --- [.naming.updater] c.a.n.client.identify.CredentialWatcher  : null No credential found
      2021-10-28 11:27:40.281  INFO 23176 --- [.naming.updater] c.a.n.client.identify.CredentialWatcher  : null No credential found
      
      ```
   
   


-- 
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] AlbumenJ commented on issue #9238: dubbo 服务端应用 hutool 的 List> 之后启动报错

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


   可以升级到 Dubbo 3.0 会忽略掉这个错误,或者不使用 Tree 这个对象,Tree 继承了 LinkedHashMap<String, Object>,但是把泛型类型给修改了,导致 Dubbo 将这个类识别成了 Map 都是无法取出真实泛型


-- 
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