Spring Boot with PostgreSQL, Flyway, and JSONB

Spring Boot with PostgreSQL, Flyway, and JSONB

This article presents how a developer can integrate Spring Boot and PostgreSQL, using some exclusive property and NoSQL column types.

Ricardo Quiroga

hi, bom tutorial!

I would like to know how you can make own queries to jsonb that is stored in the database.

Ahoora Bagheri

very useful tutorial

Charly

Very nice. Would be helpful for in-memory unit testing as well. It’s been a pain to get jsonb implemented with h2.

Matt Raible

Charly - you might be able to use Testcontainers for this. See Baeldung’s DB Integration Tests with Spring Boot and Testcontainers for more information.

Charly

Great suggestion! I attempted this before with no success as I required being in a Gitlab-CI environment, which didn’t support DinD at the time.
Got it running this time-around with no sweat - https://www.testcontainers…

Ravi Kant

Caused by: java.lang.NoClassDefFoundError: org/flywaydb/core/api/configuration/FluentConfiguration

Matt Raible

I need more information to help you. Are you using the example from GitHub or did you follow this tutorial? If you’re doing this tutorial, make sure your version numbers match.

I searched for this error on Google and found this Stack Overflow answer that might help too.

Samir Agayarov

Thanks for posting helpful information! It would be also great if you could add find by part (author, review , etc)

Sonal C

I was unable to complete the step with the Oauth Access token. The OIDC Debugger did not return a token, but the following error message:
Identity Provider: Unknown
Error Code: invalid_client
Description: Invalid value for ‘client_id’ parameter.

I’ve double checked my Web Service and Client ID and they are both in accordance with this tutorial.

Any help is appreciated!

Matt Raible

I’ve seen this error before when I didn’t copy/paste the correct client ID after registering my app on Okta. You might try copying the one from you app, then go to Okta and search for it on the applications page. If you find it, then maybe you’re putting it in the wrong file?
You can also try comparing your code to the code in the GitHub repo for this blog post. SmartSynchronize and Beyond Compare are tools I recommend for comparing directories and their contents.

Philippe Soares

Won’t teacherService.addReview throw an exception if 2 transactions try to update reviews, since the isolation level is set to serializable?

Samual Northon

Cool tutorial! Instead of the Initializr you can get quite far using bootify.io, giving you the database and REST stuff. Flyway you have to add youself though.