Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

953
Vistas
Spring Tool Suite: @Configuration class may not be final. Remove the final modifier to continue

I am unable to launch my spring boot kotlin app, due to the following:

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: @Configuration class 'TestApplication' may not be final. Remove the final modifier to continue.

I know that @configuration and @bean classes cannot be final so I add the allopen plugin in my pom file:

<build>
    <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
    <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-maven-plugin</artifactId>
            <configuration>
                <args>
                    <arg>-Xjsr305=strict</arg>
                </args>
                <compilerPlugins>
                    <plugin>spring</plugin>
                </compilerPlugins>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-allopen</artifactId>
                    <version>${kotlin.version}</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

If I package my application and run it (java -jar) it works, but when I try to launch it from STS it won't work.

Kotlin version: 1.2.71 Kotlin eclipse plugin: 0.8.13 STS: 3.9.5

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

This Question Can be Duplicate of :

IntelliJ Idea 2017.3 unable to start Kotlin Spring Boot App - @Configuration class may not be final

or

Used kotlin-spring plugin, still getting class not open error

. Anyways , I Just found Solution

You Just need to add open modifier to TestApplication kotlin class

@SpringBootApplication
open class TestApplication 

might Solve your Issue .

over 4 years ago · Santiago Trujillo Denunciar

0

I had the same problem. You must configure the Kotlin plugin under Preferences > Kotlin > Compiler and enable Compiler plugins spring.

Kotlin Compiler Configuration Dialog

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda