spring-boot

Manage Spring Boot Profiles with Gradle

江枫思渺然 提交于 2021-02-11 12:05:36
问题 I have a Spring boot application which is managed by Gradle. What is done so far: Created application.yaml , application-dev.yaml , and application-qa.yaml files Mentioned spring: profiles: active: dev in application.yaml (default profile should be dev if none is mentioned) What need to be done: Need to build war with profile mentioned or passed while building. Example, for QA build, spring: profiles: active: should have value qa , so that it can pick-up application-qa.yaml properties. If no

Question about Spring Data JDBC + Hikari + Postgres JSONB

陌路散爱 提交于 2021-02-11 10:11:21
问题 I'm trying to build an API using Spring Boot Data JDBC with Postgres. I have a simple pojo that I wish to write to a table: public final class Test { private final String id; private final String definition; } The table has 2 columns, a varchar id column and a jsonb definition column. When using a simple CRUD repository to save the pojo, I get the following error. ERROR: column "definition" is of type jsonb but expression is of type character varying The solution for this would normally be to

Question about Spring Data JDBC + Hikari + Postgres JSONB

╄→гoц情女王★ 提交于 2021-02-11 10:11:01
问题 I'm trying to build an API using Spring Boot Data JDBC with Postgres. I have a simple pojo that I wish to write to a table: public final class Test { private final String id; private final String definition; } The table has 2 columns, a varchar id column and a jsonb definition column. When using a simple CRUD repository to save the pojo, I get the following error. ERROR: column "definition" is of type jsonb but expression is of type character varying The solution for this would normally be to

Question about Spring Data JDBC + Hikari + Postgres JSONB

左心房为你撑大大i 提交于 2021-02-11 10:10:44
问题 I'm trying to build an API using Spring Boot Data JDBC with Postgres. I have a simple pojo that I wish to write to a table: public final class Test { private final String id; private final String definition; } The table has 2 columns, a varchar id column and a jsonb definition column. When using a simple CRUD repository to save the pojo, I get the following error. ERROR: column "definition" is of type jsonb but expression is of type character varying The solution for this would normally be to

Question about Spring Data JDBC + Hikari + Postgres JSONB

北战南征 提交于 2021-02-11 10:10:22
问题 I'm trying to build an API using Spring Boot Data JDBC with Postgres. I have a simple pojo that I wish to write to a table: public final class Test { private final String id; private final String definition; } The table has 2 columns, a varchar id column and a jsonb definition column. When using a simple CRUD repository to save the pojo, I get the following error. ERROR: column "definition" is of type jsonb but expression is of type character varying The solution for this would normally be to

Question about Spring Data JDBC + Hikari + Postgres JSONB

血红的双手。 提交于 2021-02-11 10:09:38
问题 I'm trying to build an API using Spring Boot Data JDBC with Postgres. I have a simple pojo that I wish to write to a table: public final class Test { private final String id; private final String definition; } The table has 2 columns, a varchar id column and a jsonb definition column. When using a simple CRUD repository to save the pojo, I get the following error. ERROR: column "definition" is of type jsonb but expression is of type character varying The solution for this would normally be to

Spring boot security - multiple WebSecurityConfigurerAdapter

五迷三道 提交于 2021-02-11 07:39:39
问题 I have an auth-cas library that provides authentication to my spring boot project. In this auth-cas library there is a class that extends WebSecurityConfigurerAdapter with following configure function @Override @ConditionalOnProperty(value = "ugent.cas.serviceUrl", matchIfMissing = true) @ConditionalOnClass(Cas.class) protected void configure(HttpSecurity http) throws Exception { http.exceptionHandling().authenticationEntryPoint(casAuthenticationEntryPoint()); if (basicAuthenticationProviders

Spring boot security - multiple WebSecurityConfigurerAdapter

假装没事ソ 提交于 2021-02-11 07:37:32
问题 I have an auth-cas library that provides authentication to my spring boot project. In this auth-cas library there is a class that extends WebSecurityConfigurerAdapter with following configure function @Override @ConditionalOnProperty(value = "ugent.cas.serviceUrl", matchIfMissing = true) @ConditionalOnClass(Cas.class) protected void configure(HttpSecurity http) throws Exception { http.exceptionHandling().authenticationEntryPoint(casAuthenticationEntryPoint()); if (basicAuthenticationProviders

How to pass flags to java process in Docker contatiner built by Cloud Native Buildpacks (CNB)

五迷三道 提交于 2021-02-11 07:23:56
问题 Normally when I create Docker image I do something like this: FROM openjdk:15-jdk-slim ARG version=undefined LABEL version=${version} WORKDIR / COPY build/libs/v2t-api-$version.jar /v2t-api.jar USER nobody VOLUME ["/tmp"] EXPOSE 8080 EXPOSE 8081 ENTRYPOINT ["sh", "-c", "exec java ${JAVA_OPTS} -jar v2t-api.jar"] So, when I start my container in for example kubernetes I can set JAVA_OPTS which defines how many memory is available for heap or how many CPUs are actually there. Packaging OCI

Liquibase in Spring boot application keeps 10 connections open

北城余情 提交于 2021-02-11 07:21:05
问题 I'm working on a Spring Boot application with Liquibase integration to setup the database. We use a different user for the database changes which we configured using the application.properties file liquibase.user=abc liquibase.password=xyz liquibase.url=jdbc:postgresql://something.eu-west-1.rds.amazonaws.com:5432/app?ApplicationName=${appName}-liquibase liquibase.enabled=true liquibase.contexts=dev,postgres We have at this moment 3 different microservices in deployment and we noticed that for