2022-09-19 09:42:03.038 ERROR 115707 --- [ main] o.s.boot.SpringApplication : Application run failed

Viewed 28

If I start the spring boot project it comes this error:

2022-09-19 09:42:03.038 ERROR 115707 --- [           main] o.s.boot.SpringApplication               : Application run failed

> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'flywayInitializer' defined in class path
> resource
> [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]:
> Invocation of init method failed; nested exception is
> org.flywaydb.core.api.FlywayException: Found non-empty schema(s)
> `zeiterfassung` but no schema history table. Use baseline() or set
> baselineOnMigrate to true to initialize the schema history table.     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
> ~[spring-beans-5.3.22.jar:5.3.22]     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
> ~[spring-beans-5.3.22.jar:5.3.22]     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
> ~[spring-beans-5.3.22.jar:5.3.22]     at
> org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
> ~[spring-beans-5.3.22.jar:5.3.22]     at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
> ~[spring-beans-5.3.22.jar:5.3.22]     at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
> ~[spring-beans-5.3.22.jar:5.3.22]     at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
> ~[spring-beans-5.3.22.jar:5.3.22]     at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
> ~[spring-beans-5.3.22.jar:5.3.22]     at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
> ~[spring-beans-5.3.22.jar:5.3.22]     at
> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154)
> ~[spring-context-5.3.22.jar:5.3.22]   at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908)
> ~[spring-context-5.3.22.jar:5.3.22]   at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
> ~[spring-context-5.3.22.jar:5.3.22]   at
> org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
> ~[spring-boot-2.7.3.jar:2.7.3]    at
> org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734)
> ~[spring-boot-2.7.3.jar:2.7.3]    at
> org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
> ~[spring-boot-2.7.3.jar:2.7.3]    at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
> ~[spring-boot-2.7.3.jar:2.7.3]    at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
> ~[spring-boot-2.7.3.jar:2.7.3]    at
org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:66)
> ~[spring-boot-autoconfigure-2.7.3.jar:2.7.3]  at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
> ~[spring-beans-5.3.22.jar:5.3.22]     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
> ~[spring-beans-5.3.22.jar:5.3.22]     ... 18 common frames omitted
> 
> 
> Process finished with exit code 1

but this is the only error code that exists.

pom.xml

  <?xml version="1.0" encoding="UTF-8"?>
    <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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.7.3</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>
        <groupId>ch.ejpd</groupId>
        <artifactId>backend-zeiterfassung</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <name>backend-zeiterfassung</name>
        <description>backend for our project, zeiterfassung</description>
        <properties>
            <java.version>17</java.version>
        </properties>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-jpa</artifactId>
            </dependency>
            <dependency>
                <groupId>org.flywaydb</groupId>
                <artifactId>flyway-core</artifactId>
            </dependency>
            <dependency>
                <groupId>org.flywaydb</groupId>
                <artifactId>flyway-mysql</artifactId>
            </dependency>
            <dependency>
                <groupId>org.mariadb.jdbc</groupId>
                <artifactId>mariadb-java-client</artifactId>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
        </dependencies>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
                <plugin>
                    <groupId>org.flywaydb</groupId>
                    <artifactId>flyway-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </build>
    </project>

This is an maven project with docker, flyway and a mariadb.

The connetction to the db is flawless. The same with flyway.

In the pom file i have an error that make no sense. It says nothing it is only red

error pom file

0 Answers
Related