I have a Spring Boot App using an Oracle Data source that is freezing on startup. The last messages outputted on the console are:
[2017-12-18T15:34:19,425] INFO org.hibernate.dialect.Dialect HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect
[2017-12-18T15:34:27,186] INFO org.hibernate.hql.internal.QueryTranslatorFactoryInitiator HHH000397: Using ASTQueryTranslatorFactory
After that it just hangs indefinitely. No more debug messages are outputted, and nothing happens. I've let it sit there for hours, but nothing.
The weird thing is that everything was working fine. No changes were made. All of a sudden this started happening, and I have no idea why it's just freezing.
First change the start-class to your application class. Second add the super-cool Spring Boot maven builder to your pom. Then use "mvn install" to create your jar. Your code runs just fine.
We know that a Spring Boot web app needs an embedded servlet container on the classpath. The app will shut down if it doesn't find any of the embedded servlet containers. To resolve the unexpected shut down during startup, we need to obtain a fully configured instance using the appropriate Starter.
It's hard to tell what happens out of the information you've provided, I can just propose a couple of things that can shed some light on whats going on:
Try to take thread dump and see what exactly does each thread do. If you will take some thread dumps and will see that thread that looks relevant is stuck somewhere you'll probably be able to better understand the reason from the stacktrace.
Enable logs for DEBUG, you say that no debug messages appear, but in the snippet, you've shown only a couple of INFO messages. You can probably start with setting spring and hibernate logs for DEBUG.
Try to connect to the empty database - maybe it tries to read something during the initialization (stuff like metadata) and it takes too long (although I don't believe it should take hours), but still...
You can try to see which SQLs are being executed during the startup. Just set hibernate's "show sql" property to true and maybe it will help
You can also place a breakpoint in spring to see which bean gets stuck and try to understand out of its code whats going on (I know its a little bit vague, but the point is to find which bean fails to start and just debug it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With