790477691 commented on issue #23796:
URL: 
https://github.com/apache/shardingsphere/issues/23796#issuecomment-1409802183

   @RaigorJiang An error occurred when I used shardingsphere-example-generator 
to generate the use case. I just changed the version number from 5.3.1 to 
5.3.2-SNAPSHOT, but an error occurred when I ran it
   
   ```text
   Exception in thread "main" Cannot create property=products for 
JavaBean=org.apache.shardingsphere.example.generator.core.yaml.config.YamlExampleConfiguration@23fe1d71
    in 'reader', line 1, column 1:
       output: ./examples/shardingspher ... 
       ^
   No single argument constructor found for interface java.util.List
    in 'reader', line 2, column 11:
       products: jdbc
                 ^
   
        at 
org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:321)
        at 
org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:207)
        at 
org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:358)
        at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:270)
        at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:253)
        at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:207)
        at 
org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:191)
        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:477)
        at org.yaml.snakeyaml.Yaml.loadAs(Yaml.java:443)
        at 
org.apache.shardingsphere.infra.util.yaml.YamlEngine.unmarshal(YamlEngine.java:55)
        at 
org.apache.shardingsphere.example.generator.core.ExampleGeneratorFactory.swapConfigToObject(ExampleGeneratorFactory.java:110)
        at 
org.apache.shardingsphere.example.generator.core.ExampleGeneratorFactory.buildExampleConfiguration(ExampleGeneratorFactory.java:72)
        at 
org.apache.shardingsphere.example.generator.core.ExampleGeneratorFactory.generate(ExampleGeneratorFactory.java:64)
        at 
org.apache.shardingsphere.example.generator.ExampleGeneratorMain.main(ExampleGeneratorMain.java:43)
   Caused by: org.yaml.snakeyaml.error.YAMLException: No single argument 
constructor found for interface java.util.List
        at 
org.yaml.snakeyaml.constructor.Constructor$ConstructScalar.construct(Constructor.java:417)
        at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:270)
        at 
org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:253)
        at 
org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.newInstance(Constructor.java:333)
        at 
org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:298)
        ... 13 more
   ```
   
   
   shardingsphere-example-generator   config.xml
   ```text
   output: ./examples/shardingsphere-example-generator/target/generated-sources/
   products: jdbc
   modes: standalone
   transactions: local
   features: sharding
   frameworks: spring-namespace-jdbc
   props:
     host: localhost
     port: 3306
     username: root
     password: root
   
   ```
   shardingsphere-examples  pom.xml
   ```text
   <?xml version="1.0" encoding="UTF-8"?>
   <!--
     ~ Licensed to the Apache Software Foundation (ASF) under one or more
     ~ contributor license agreements.  See the NOTICE file distributed with
     ~ this work for additional information regarding copyright ownership.
     ~ The ASF licenses this file to You under the Apache License, Version 2.0
     ~ (the "License"); you may not use this file except in compliance with
     ~ the License.  You may obtain a copy of the License at
     ~
     ~     http://www.apache.org/licenses/LICENSE-2.0
     ~
     ~ Unless required by applicable law or agreed to in writing, software
     ~ distributed under the License is distributed on an "AS IS" BASIS,
     ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     ~ See the License for the specific language governing permissions and
     ~ limitations under the License.
     -->
   
   <project xmlns="http://maven.apache.org/POM/4.0.0";
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
            xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
       <modelVersion>4.0.0</modelVersion>
       <groupId>org.apache.shardingsphere.example</groupId>
       <artifactId>shardingsphere-examples</artifactId>
       <version>${revision}</version>
       <packaging>pom</packaging>
       <name>${project.artifactId}</name>
   
       
       <modules>
           <module>example-core</module>
           <module>shardingsphere-proxy-example</module>
           <module>shardingsphere-parser-example</module>
           <module>shardingsphere-example-generator</module>
       </modules>
       
       <properties>
           <revision>5.3.2-SNAPSHOT</revision>
           <java.version>1.8</java.version>
           <maven.version.range>[3.0.4,)</maven.version.range>
           <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
           <project.build.locale>zh_CN</project.build.locale>
           <aspectjweaver.version>1.8.9</aspectjweaver.version>
           <spring-framework.version>5.2.15.RELEASE</spring-framework.version>
           <spring-boot.version>2.3.12.RELEASE</spring-boot.version>
           <hikari-cp.version>3.4.2</hikari-cp.version>
           <mysql-connector-java.version>5.1.47</mysql-connector-java.version>
           <postgresql.version>42.4.1</postgresql.version>
           <h2.version>2.1.214</h2.version>
           <slf4j.version>1.7.7</slf4j.version>
           <logback.version>1.2.10</logback.version>
           <lombok.version>1.18.20</lombok.version>
           <mybatis.version>3.5.9</mybatis.version>
           <mybatis-spring.version>2.0.5</mybatis-spring.version>
           <mybatis-spring-boot.version>2.1.3</mybatis-spring-boot.version>
   
           <jpa.version>1.0.0.Final</jpa.version>
           <hibernate.version>5.4.24.Final</hibernate.version>
           <narayana.version>5.9.1.Final</narayana.version>
           
<jboss-transaction-spi.version>7.6.0.Final</jboss-transaction-spi.version>
           <jboss-logging.version>3.2.1.Final</jboss-logging.version>
           <btm.version>2.1.3</btm.version>
           
           <seata.version>1.4.2</seata.version>
           
           <junit4.version>4.13.2</junit4.version>
           <hamcrest.version>1.3</hamcrest.version>
           <mockito.version>2.7.21</mockito.version>
           
           <apache-rat-plugin.version>0.12</apache-rat-plugin.version>
           <maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
           <maven-resources-plugin.version>2.7</maven-resources-plugin.version>
           <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
           <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
           <freemarker.version>2.3.31</freemarker.version>
           <snakeyaml.version>1.33</snakeyaml.version>
           <flatten-maven-plugin.version>1.2.5</flatten-maven-plugin.version>
           
           <javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
       </properties>
       
       <dependencyManagement>
           <dependencies>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-sharding-core</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-encrypt-core</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-jdbc-core</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-transaction-core</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-transaction-xa-core</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   
<artifactId>shardingsphere-transaction-xa-bitronix</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   
<artifactId>shardingsphere-transaction-xa-narayana</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   
<artifactId>shardingsphere-transaction-base-seata-at</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   
<artifactId>shardingsphere-cluster-mode-repository-zookeeper</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   
<artifactId>shardingsphere-cluster-mode-repository-etcd</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   
<artifactId>shardingsphere-cluster-mode-repository-nacos</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-infra-common</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-sql-parser-engine</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-sql-parser-mysql</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-sql-parser-oracle</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-sql-parser-sql92</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-sql-parser-postgresql</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-sql-parser-sqlserver</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-sql-parser-opengauss</artifactId>
                   <version>${project.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>shardingsphere-parser-core</artifactId>
                   <version>${project.version}</version>
               </dependency>
               
               <dependency>
                   <groupId>org.yaml</groupId>
                   <artifactId>snakeyaml</artifactId>
                   <version>${snakeyaml.version}</version>
               </dependency>
               
               <dependency>
                   <groupId>org.springframework</groupId>
                   <artifactId>spring-orm</artifactId>
                   <version>${spring-framework.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.springframework</groupId>
                   <artifactId>spring-context-support</artifactId>
                   <version>${spring-framework.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.springframework</groupId>
                   <artifactId>spring-context</artifactId>
                   <version>${spring-framework.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.springframework</groupId>
                   <artifactId>spring-jdbc</artifactId>
                   <version>${spring-framework.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.springframework</groupId>
                   <artifactId>spring-tx</artifactId>
                   <version>${spring-framework.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.springframework.boot</groupId>
                   <artifactId>spring-boot-starter-data-jpa</artifactId>
                   <version>${spring-boot.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.springframework.boot</groupId>
                   <artifactId>spring-boot-starter-aop</artifactId>
                   <version>${spring-boot.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.springframework.boot</groupId>
                   <artifactId>spring-boot-starter-jdbc</artifactId>
                   <version>${spring-boot.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.aspectj</groupId>
                   <artifactId>aspectjweaver</artifactId>
                   <version>${aspectjweaver.version}</version>
               </dependency>
               
               <dependency>
                   <groupId>org.hibernate.javax.persistence</groupId>
                   <artifactId>hibernate-jpa-2.1-api</artifactId>
                   <version>${jpa.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.hibernate</groupId>
                   <artifactId>hibernate-core</artifactId>
                   <version>${hibernate.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.hibernate</groupId>
                   <artifactId>hibernate-entitymanager</artifactId>
                   <version>${hibernate.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.mybatis</groupId>
                   <artifactId>mybatis</artifactId>
                   <version>${mybatis.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.mybatis</groupId>
                   <artifactId>mybatis-spring</artifactId>
                   <version>${mybatis-spring.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.mybatis.spring.boot</groupId>
                   <artifactId>mybatis-spring-boot-starter</artifactId>
                   <version>${mybatis-spring-boot.version}</version>
               </dependency>
               
               <dependency>
                   <groupId>org.jboss.narayana.jta</groupId>
                   <artifactId>jta</artifactId>
                   <version>${narayana.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.jboss.narayana.jts</groupId>
                   <artifactId>narayana-jts-integration</artifactId>
                   <version>${narayana.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.jboss</groupId>
                   <artifactId>jboss-transaction-spi</artifactId>
                   <version>${jboss-transaction-spi.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.jboss.logging</groupId>
                   <artifactId>jboss-logging</artifactId>
                   <version>${jboss-logging.version}</version>
               </dependency>
               <dependency>
                   <groupId>org.codehaus.btm</groupId>
                   <artifactId>btm</artifactId>
                   <version>${btm.version}</version>
               </dependency>
               <dependency>
                   <groupId>io.seata</groupId>
                   <artifactId>seata-all</artifactId>
                   <version>${seata.version}</version>
               </dependency>
   
               <dependency>
                   <groupId>org.freemarker</groupId>
                   <artifactId>freemarker</artifactId>
                   <version>${freemarker.version}</version>
               </dependency>
               
               <dependency>
                   <groupId>org.springframework.boot</groupId>
                   <artifactId>spring-boot-starter-test</artifactId>
                   <version>${spring-boot.version}</version>
                   <scope>test</scope>
               </dependency>
               <dependency>
                   <groupId>org.springframework</groupId>
                   <artifactId>spring-test</artifactId>
                   <version>${spring-framework.version}</version>
                   <scope>test</scope>
               </dependency>
           </dependencies>
       </dependencyManagement>
       
       <dependencies>
           <dependency>
               <groupId>org.projectlombok</groupId>
               <artifactId>lombok</artifactId>
               <version>${lombok.version}</version>
               <scope>provided</scope>
           </dependency>
           
           <dependency>
               <groupId>org.postgresql</groupId>
               <artifactId>postgresql</artifactId>
               <version>${postgresql.version}</version>
           </dependency>
           <dependency>
               <groupId>mysql</groupId>
               <artifactId>mysql-connector-java</artifactId>
               <version>${mysql-connector-java.version}</version>
           </dependency>
           <dependency>
               <groupId>com.h2database</groupId>
               <artifactId>h2</artifactId>
               <version>${h2.version}</version>
               <scope>runtime</scope>
           </dependency>
           
           <dependency>
               <groupId>com.zaxxer</groupId>
               <artifactId>HikariCP</artifactId>
               <version>${hikari-cp.version}</version>
           </dependency>
           
           <dependency>
               <groupId>org.slf4j</groupId>
               <artifactId>jcl-over-slf4j</artifactId>
               <version>${slf4j.version}</version>
           </dependency>
           <dependency>
               <groupId>ch.qos.logback</groupId>
               <artifactId>logback-classic</artifactId>
               <version>${logback.version}</version>
           </dependency>
           
           <dependency>
               <groupId>junit</groupId>
               <artifactId>junit</artifactId>
               <version>${junit4.version}</version>
               <scope>provided</scope>
           </dependency>
           <dependency>
               <groupId>org.hamcrest</groupId>
               <artifactId>hamcrest-library</artifactId>
               <version>${hamcrest.version}</version>
               <scope>provided</scope>
           </dependency>
           <dependency>
               <groupId>org.mockito</groupId>
               <artifactId>mockito-core</artifactId>
               <version>${mockito.version}</version>
               <scope>provided</scope>
               <exclusions>
                   <exclusion>
                       <groupId>org.hamcrest</groupId>
                       <artifactId>hamcrest-core</artifactId>
                   </exclusion>
               </exclusions>
           </dependency>
           <dependency>
               <groupId>org.mockito</groupId>
               <artifactId>mockito-inline</artifactId>
               <version>${mockito.version}</version>
               <scope>provided</scope>
           </dependency>
       </dependencies>
       
       <profiles>
           <profile>
               <id>jdk11+</id>
               <activation>
                   <jdk>[11,)</jdk>
               </activation>
               <properties>
                   <annotation-api.version>1.3.2</annotation-api.version>
               </properties>
               <dependencies>
                   <dependency>
                       <groupId>javax.annotation</groupId>
                       <artifactId>javax.annotation-api</artifactId>
                       <version>${annotation-api.version}</version>
                   </dependency>
               </dependencies>
           </profile>
       </profiles>
       
       <build>
           <plugins>
               <plugin>
                   <artifactId>maven-compiler-plugin</artifactId>
                   <configuration>
                       <source>${java.version}</source>
                       <target>${java.version}</target>
                       <testSource>${java.version}</testSource>
                       <testTarget>${java.version}</testTarget>
                   </configuration>
                   <version>${maven-compiler-plugin.version}</version>
               </plugin>
               <plugin>
                   <artifactId>maven-resources-plugin</artifactId>
                   <version>${maven-resources-plugin.version}</version>
               </plugin>
               <plugin>
                   <artifactId>maven-jar-plugin</artifactId>
                   <version>${maven-jar-plugin.version}</version>
               </plugin>
               <plugin>
                   <artifactId>maven-source-plugin</artifactId>
                   <version>${maven-source-plugin.version}</version>
                   <executions>
                       <execution>
                           <id>attach-sources</id>
                           <phase>verify</phase>
                           <goals>
                               <goal>jar-no-fork</goal>
                           </goals>
                       </execution>
                   </executions>
               </plugin>
               <plugin>
                   <groupId>org.apache.rat</groupId>
                   <artifactId>apache-rat-plugin</artifactId>
                   <version>${apache-rat-plugin.version}</version>
                   <configuration>
                       <excludes>
                           <exclude>**/target/**</exclude>
                           <exclude>**/logs/**</exclude>
                           <exclude>**/*.log</exclude>
                           <!-- IDE files -->
                           <exclude>**/*.iml</exclude>
                           <exclude>**/.idea/**</exclude>
                           <exclude>**/*.classpath</exclude>
                           <exclude>**/.project</exclude>
                           <exclude>**/.settings/**</exclude>
                           <exclude>**/dependency-reduced-pom.xml</exclude>
                           <!-- git files -->
                           <exclude>**/.gitignore</exclude>
                           <exclude>**/.gitmodules</exclude>
                           <exclude>**/.git/**</exclude>
                           <!-- CI files -->
                           <exclude>**/.travis.yml</exclude>
                           <exclude>**/.mvn/jvm.config</exclude>
                           
<exclude>**/.mvn/wrapper/maven-wrapper.properties</exclude>
                           <!-- GitHub files -->
                           <exclude>**/.github/**</exclude>
                           <!-- document files -->
                           <exclude>**/*.md</exclude>
                           <excldue>**/*.MD</excldue>
                           <exclude>**/*.txt</exclude>
                           <exclude>**/docs/**</exclude>
                       </excludes>
                   </configuration>
                   <executions>
                       <execution>
                           <phase>verify</phase>
                           <goals>
                               <goal>check</goal>
                           </goals>
                       </execution>
                   </executions>
               </plugin>
               <plugin>
                   <groupId>org.codehaus.mojo</groupId>
                   <artifactId>flatten-maven-plugin</artifactId>
                   <version>${flatten-maven-plugin.version}</version>
                   <configuration>
                       <updatePomFile>true</updatePomFile>
                   </configuration>
                   <executions>
                       <execution>
                           <id>flatten</id>
                           <phase>process-resources</phase>
                           <goals>
                               <goal>flatten</goal>
                           </goals>
                       </execution>
                       <execution>
                           <id>flatten.clean</id>
                           <phase>clean</phase>
                           <goals>
                               <goal>clean</goal>
                           </goals>
                       </execution>
                   </executions>
               </plugin>
           </plugins>
       </build>
   </project>
   
   ```
   
   


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

Reply via email to