I also tried by myself with the tutorial from jetb...
# spring
a
I also tried by myself with the tutorial from jetbrains: https://kotlinlang.org/docs/tutorials/spring-boot-restful.html
c
and your Application file?
a
Copy code
@SpringBootApplication
class Application

fun main(args: Array<String>) {
    runApplication<Application>(*args)
}
again, same as in the template
c
hmm let me check something...
I've just copy pasted your code and it works. Where do you get the error?
I always get told that Application is final
I mean what tells you that?
looks correct, too
a
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: @Configuration class 'Application' may not be final.
When I run the app
c
via IntelliJ or
bootRun
task?
a
IntelliJ
c
try bootRun to make sure that the setup is in fact correct with gradle and then we'll see what we can do about IJ
a
yeah bootRun works
c
Ok, then: 1) Ctrl+Shift+A -> refresh all gradle projects <enter> 2) When the 1) finishes: Ctrl+Shift+A -> Rebuild Project when that finishes try to run again
The listed shortcut is standard for Linux/Windows, it's the shortcut for "Find action", in case you're on a different OS or hotkey schema.
a
Wow that really did it. Thanks a lot !
👍 1
c
You have to do that when you change something in gradle, so that IJ picks up the changes.
oh, most of the time (if you didn't replace any used dependencies) you can skip the rebuild part. In fact I only do the rebuild if something doesn't work after the refresh.
n
when using maven just enable auto-import and forget about it (just saying 😉)
c
same with gradle, but auto-import is not ideal especially when you're actively changing build configuration, you don't want IJ to constantly try to refresh half-configured project. For small projects, yeah, auto-import is ok.
n
ok