Help Center> ServiceStage> FAQ> Application Development> Common Problems About Switching of SpringBoot Applications to CSE Java SDK Framework

Common Problems About Switching of SpringBoot Applications to CSE Java SDK Framework

Failed to Initialize the Container

  • Symptom: The error message "Unable to start embedded container" is displayed during initialization.

    This problem occurs if the resource directory contains application properties.

  • Cause: By default, Spring starts the built-in container (Servlet dependency is imported to Vert.x).
  • Solution: Modify SpringApplication.run (TestspringbootApplication.class, args) to web selection disabled. The code is as follows:
    1
    new SpringApplicationBuilder().sources(TestspringbootApplication.class).web(false).run();
    

Failed to Initialize Bean Related to Database

  • Symptom: The error message "Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required" is displayed during initialization.
  • Cause: By default, spring-jdbc is set to provided for org.apache.servicecomb:java-chassis-core. As a result, the .jar package cannot be found when the program is running, leading to the initialization failure.
  • Solution: Modify scope of spring-jdbc in pom.xml.
    1
    2
    3
    4
    5
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <scope>compile</scope>
    </dependency>