Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

963
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!