ddfeiyu opened a new issue, #11158:
URL: https://github.com/apache/dubbo/issues/11158

   <!-- If you need to report a security issue please visit 
https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) 
of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.1.0
   * Operating System version: 8
   * Java version: MAC M1
   
   ### Steps to reproduce this issue
   
   1.  pom.xml配置
   ```
    <dubbo.version>3.1.0</dubbo.version>
       
<dubbo-dependencies-zookeeper.version>3.1.0</dubbo-dependencies-zookeeper.version>
   <dependency>
         <groupId>org.apache.dubbo</groupId>
         <artifactId>dubbo</artifactId>
         <version>${dubbo.version}</version>
         <exclusions>
           <exclusion>
             <artifactId>spring-context</artifactId>
             <groupId>org.springframework</groupId>
           </exclusion>
           <exclusion>
             <artifactId>fastjson</artifactId>
             <groupId>com.alibaba</groupId>
           </exclusion>
           <exclusion>
             <groupId>org.javassist</groupId>
             <artifactId>javassist</artifactId>
           </exclusion>
           <exclusion>
             <artifactId>netty-all</artifactId>
             <groupId>io.netty</groupId>
           </exclusion>
         </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.dubbo</groupId>
         <artifactId>dubbo-dependencies-zookeeper</artifactId>
         <version>${dubbo-dependencies-zookeeper.version}</version>
         <type>pom</type>
         <exclusions>
           <exclusion>
             <artifactId>slf4j-api</artifactId>
             <groupId>org.slf4j</groupId>
           </exclusion>
           <exclusion>
             <artifactId>log4j</artifactId>
             <groupId>log4j</groupId>
           </exclusion>
           <exclusion>
             <artifactId>slf4j-log4j12</artifactId>
             <groupId>org.slf4j</groupId>
           </exclusion>
           <exclusion>
             <artifactId>guava</artifactId>
             <groupId>com.google.guava</groupId>
           </exclusion>
           <exclusion>
             <groupId>org.codehaus.jackson</groupId>
             <artifactId>jackson-mapper-asl</artifactId>
           </exclusion>
         </exclusions>
       </dependency>
   ```
   3.   自定义线程池配置类ProviderConfiguration
    ```
   package com.tem.platform.configuration;
   
   
   import com.iplatform.common.utils.LogUtils;
   import com.tem.platform.manager.dubbo.executor.DemoServiceExecutor;
   import lombok.extern.slf4j.Slf4j;
   import org.springframework.context.annotation.Bean;
   import org.springframework.context.annotation.Configuration;
   
   import java.util.concurrent.Executor;
   
   @Slf4j
   @Configuration
   public class ProviderConfiguration {
   
       /**
        * customized thread pool
        * @return
        */
       @Bean("executor-demo-service")
       public Executor demoServiceExecutor() {
           LogUtils.info(log, "自定义线程池 executor-demo-service");
           return new DemoServiceExecutor();
       }
   
   }
   
   ```
   5. 自定义线程池bean
   ```
   package com.tem.platform.manager.dubbo.executor;
   
   import org.apache.dubbo.common.utils.NamedThreadFactory;
   
   import java.util.concurrent.LinkedBlockingDeque;
   import java.util.concurrent.ThreadPoolExecutor;
   import java.util.concurrent.TimeUnit;
   
   /**
    * customized thread pool
    */
   public class DemoServiceExecutor extends ThreadPoolExecutor {
   
       public DemoServiceExecutor() {
           super(10,
                   10,
                   60,
                   TimeUnit.SECONDS,
                   new LinkedBlockingDeque<>(),
                   new NamedThreadFactory("DemoServiceExecutor"));
       }
   
   }
   
   
   ```
   7. dubbo-service.xml
   ```
   <!-- customized thread pool : -->
        <bean id="executor-demo-service"
                  
class="com.tem.platform.manager.dubbo.executor.DemoServiceExecutor"/>
   
        <dubbo:service interface="com.dd.api.UserService" ref="userService" 
protocol="dubbo" timeout="300000" retries="0" executor="executor-demo-service" 
/>
   
   
   ```
   8. 报错
   ```
   2022-12-16 10:21:14,377 ERROR 
[org.springframework.web.context.ContextLoader]  - Context initialization failed
   org.springframework.beans.factory.parsing.BeanDefinitionParsingException: 
Configuration problem: Failed to import bean definitions from relative location 
[dubbo-config.xml]
   Offending resource: class path resource [spring/applicationContext.xml]; 
nested exception is 
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 32 
in XML document from class path resource [spring/dubbo-config.xml] is invalid; 
nested exception is org.xml.sax.SAXParseException; lineNumber: 32; 
columnNumber: 39; cvc-datatype-valid.1.2.1: '' is not a valid value for 
'integer'.
        
   ```
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Behavior
   
   <!-- What do you expect from the above steps?-->
   
   ### Actual Behavior
   
   <!-- What actually happens? -->
   
   If there is an exception, please attach the exception trace:
   
   ```
   Just put your stack trace here!
   ```
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to