R2DBC errors after upgrading to Spring Boot 2.6

See original GitHub issue
Overview of the issue

The upgrade to Spring Boot 2.6 is happening in https://github.com/jhipster/generator-jhipster/pull/16787. Tests are currently failing for the vue-gateway project because of an R2DBC issue.

Error:  tech.jhipster.sample.web.rest.OperationResourceIT.putNewOperation  Time elapsed: 0.016 s  <<< ERROR!
org.springframework.r2dbc.BadSqlGrammarException: 
executeMany; bad SQL grammar [SELECT e.id AS e_id, e.date AS e_date, e.description AS e_description, e.amount AS e_amount, 
e.bank_account_id AS e_bank_account_id, bankAccount.id AS bankAccount_id, bankAccount.name AS bankAccount_name, 
bankAccount.guid AS bankAccount_guid, bankAccount.bank_number AS bankAccount_bank_number, 
bankAccount.agency_number AS bankAccount_agency_number, bankAccount.last_operation_duration AS 
bankAccount_last_operation_duration, bankAccount.mean_operation_duration AS bankAccount_mean_operation_duration, 
bankAccount.mean_queue_duration AS bankAccount_mean_queue_duration, bankAccount.balance AS bankAccount_balance, 
bankAccount.opening_day AS bankAccount_opening_day, bankAccount.last_operation_date AS 
bankAccount_last_operation_date, bankAccount.active AS bankAccount_active, bankAccount.account_type AS 
bankAccount_account_type, bankAccount.attachment AS bankAccount_attachment, bankAccount.attachment_content_type AS 
bankAccount_attachment_content_type, bankAccount.description AS bankAccount_description, bankAccount.user_id AS 
bankAccount_user_id FROM operation e LEFT OUTER JOIN bank_account bankAccount ON e.bank_account_id = bankAccount.id 
WHERE id = 4 WHERE e.id = 4]; nested exception is io.r2dbc.spi.R2dbcBadGrammarException: [90059] [90059] Ambiguous 
column name "ID"; SQL statement:
SELECT e.id AS e_id, e.date AS e_date, e.description AS e_description, e.amount AS e_amount, e.bank_account_id AS 
e_bank_account_id, bankAccount.id AS bankAccount_id, bankAccount.name AS bankAccount_name, bankAccount.guid AS 
bankAccount_guid, bankAccount.bank_number AS bankAccount_bank_number, bankAccount.agency_number AS 
bankAccount_agency_number, bankAccount.last_operation_duration AS bankAccount_last_operation_duration, 
bankAccount.mean_operation_duration AS bankAccount_mean_operation_duration, bankAccount.mean_queue_duration AS 
bankAccount_mean_queue_duration, bankAccount.balance AS bankAccount_balance, bankAccount.opening_day AS 
bankAccount_opening_day, bankAccount.last_operation_date AS bankAccount_last_operation_date, bankAccount.active AS 
bankAccount_active, bankAccount.account_type AS bankAccount_account_type, bankAccount.attachment AS 
bankAccount_attachment, bankAccount.attachment_content_type AS bankAccount_attachment_content_type, 
bankAccount.description AS bankAccount_description, bankAccount.user_id AS bankAccount_user_id FROM operation e LEFT 
OUTER JOIN bank_account bankAccount ON e.bank_account_id = bankAccount.id WHERE id = 4 WHERE e.id = 4 [90059-200]
	at tech.jhipster.sample.web.rest.OperationResourceIT.putNewOperation(OperationResourceIT.java:293)
Motivation for or Use Case

I’d like to see JHipster upgraded to Spring Boot 2.6.0 so I can try to integrate Spring Native with the latest release. I have a talk with Josh Long on Tuesday that I’d like to show off JHipster + Spring Native in. You can see our previous work with JHipster 7.2 and Spring Boot 2.5 in https://github.com/mraible/spring-native-examples.

Reproduce the error

I recreated the vue-gateway application and pushed it to GitHub:

git clone -b skip_ci-spring-boot_2.6.0 git@github.com:jhipster/jhipster-bom.git
cd jhipster-bom
./mvnw install -Dgpg.skip=true
cd ..
git clone git@github.com:mraible/vue-gateway.git
cd vue-gateway
./mvnw verify
Related issues

https://github.com/jhipster/generator-jhipster/pull/16787

JHipster Version(s)
jhipster@0.0.0 /Users/mraible/Downloads/vue-gateway
└── generator-jhipster@7.4.1

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "clientPackageManager": "npm",
    "applicationType": "gateway",
    "reactive": true,
    "baseName": "jhipster",
    "jhiPrefix": "",
    "otherModules": [],
    "skipClient": false,
    "skipServer": false,
    "skipUserManagement": false,
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "testFrameworks": ["gatling", "cypress"],
    "blueprints": [],
    "creationTimestamp": 1594452153587,
    "serviceDiscoveryType": false,
    "authenticationType": "jwt",
    "packageName": "tech.jhipster.sample",
    "packageFolder": "tech/jhipster/sample",
    "serverPort": "8080",
    "cacheProvider": "no",
    "enableHibernateCache": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "postgresql",
    "buildTool": "maven",
    "serverSideOptions": [],
    "websocket": false,
    "searchEngine": false,
    "messageBroker": false,
    "enableSwaggerCodegen": false,
    "clientFramework": "vue",
    "clientTheme": "none",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "clientThemeVariant": "primary",
    "languages": ["en"],
    "jhipsterVersion": "7.4.1",
    "pages": [],
    "devServerPort": 9060,
    "withAdminUi": true,
    "enableGradleEnterprise": false,
    "entities": [
      "Operation",
      "FieldTestEntity",
      "FieldTestInfiniteScrollEntity",
      "FieldTestMapstructAndServiceClassEntity",
      "FieldTestPaginationEntity",
      "FieldTestServiceClassAndJpaFilteringEntity",
      "FieldTestServiceImplEntity",
      "EntityWithDTO",
      "EntityWithServiceClassAndPagination",
      "EntityWithServiceImplAndPagination",
      "EntityWithServiceImplAndDTO",
      "EntityWithPaginationAndDTO",
      "EntityWithServiceClassPaginationAndDTO",
      "EntityWithServiceImplPaginationAndDTO",
      "MapsIdUserProfileWithDTO",
      "FieldTestEnumWithValue",
      "BankAccount",
      "Label"
    ]
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Operation {
  date Instant required
  description String
  amount BigDecimal required
}
entity FieldTestEntity {
  stringTom String
  stringRequiredTom String required
  stringMinlengthTom String minlength(0)
  stringMaxlengthTom String maxlength(20)
  stringPatternTom String pattern(/^[a-zA-Z0-9]*$/)
  numberPatternTom String pattern(/^[0-9]+$/)
  numberPatternRequiredTom String pattern(/^[0-9]+$/) required
  integerTom Integer
  integerRequiredTom Integer required
  integerMinTom Integer min(0)
  integerMaxTom Integer max(100)
  longTom Long
  longRequiredTom Long required
  longMinTom Long min(0)
  longMaxTom Long max(100)
  floatTom Float
  floatRequiredTom Float required
  floatMinTom Float min(0)
  floatMaxTom Float max(100)
  doubleRequiredTom Double required
  doubleMinTom Double min(0)
  doubleMaxTom Double max(100)
  bigDecimalRequiredTom BigDecimal required
  bigDecimalMinTom BigDecimal min(0)
  bigDecimalMaxTom BigDecimal max(100)
  localDateTom LocalDate
  localDateRequiredTom LocalDate required
  instantTom Instant
  instantRequiredTom Instant required
  zonedDateTimeTom ZonedDateTime
  zonedDateTimeRequiredTom ZonedDateTime required
  durationTom Duration
  durationRequiredTom Duration required
  booleanTom Boolean
  booleanRequiredTom Boolean required
  enumTom EnumFieldClass
  enumRequiredTom EnumRequiredFieldClass required
  uuidTom UUID
  uuidRequiredTom UUID required
  byteImageTom ImageBlob
  byteImageRequiredTom ImageBlob required
  byteImageMinbytesTom ImageBlob minbytes(0)
  byteImageMaxbytesTom ImageBlob maxbytes(10000)
  byteAnyTom AnyBlob
  byteAnyRequiredTom AnyBlob required
  byteAnyMinbytesTom AnyBlob minbytes(0)
  byteAnyMaxbytesTom AnyBlob maxbytes(10000)
  byteTextTom TextBlob
  byteTextRequiredTom TextBlob required
}
entity FieldTestInfiniteScrollEntity {
  stringHugo String
  stringRequiredHugo String required
  stringMinlengthHugo String minlength(0)
  stringMaxlengthHugo String maxlength(20)
  stringPatternHugo String pattern(/^[a-zA-Z0-9]*$/)
  integerHugo Integer
  integerRequiredHugo Integer required
  integerMinHugo Integer min(0)
  integerMaxHugo Integer max(100)
  longHugo Long
  longRequiredHugo Long required
  longMinHugo Long min(0)
  longMaxHugo Long max(100)
  floatHugo Float
  floatRequiredHugo Float required
  floatMinHugo Float min(0)
  floatMaxHugo Float max(100)
  doubleRequiredHugo Double required
  doubleMinHugo Double min(0)
  doubleMaxHugo Double max(100)
  bigDecimalRequiredHugo BigDecimal required
  bigDecimalMinHugo BigDecimal min(0)
  bigDecimalMaxHugo BigDecimal max(100)
  localDateHugo LocalDate
  localDateRequiredHugo LocalDate required
  instantHugo Instant
  instanteRequiredHugo Instant required
  zonedDateTimeHugo ZonedDateTime
  zonedDateTimeRequiredHugo ZonedDateTime required
  durationHugo Duration
  durationRequiredHugo Duration required
  booleanHugo Boolean
  booleanRequiredHugo Boolean required
  enumHugo EnumFieldClass
  enumRequiredHugo EnumRequiredFieldClass required
  uuidHugo UUID
  uuidRequiredHugo UUID required
  byteImageHugo ImageBlob
  byteImageRequiredHugo ImageBlob required
  byteImageMinbytesHugo ImageBlob minbytes(0)
  byteImageMaxbytesHugo ImageBlob maxbytes(10000)
  byteAnyHugo AnyBlob
  byteAnyRequiredHugo AnyBlob required
  byteAnyMinbytesHugo AnyBlob minbytes(0)
  byteAnyMaxbytesHugo AnyBlob maxbytes(10000)
  byteTextHugo TextBlob
  byteTextRequiredHugo TextBlob required
}
entity FieldTestMapstructAndServiceClassEntity {
  stringEva String
  stringRequiredEva String required
  stringMinlengthEva String minlength(0)
  stringMaxlengthEva String maxlength(20)
  stringPatternEva String pattern(/^[a-zA-Z0-9]*$/)
  integerEva Integer
  integerRequiredEva Integer required
  integerMinEva Integer min(0)
  integerMaxEva Integer max(100)
  longEva Long
  longRequiredEva Long required
  longMinEva Long min(0)
  longMaxEva Long max(100)
  floatEva Float
  floatRequiredEva Float required
  floatMinEva Float min(0)
  floatMaxEva Float max(100)
  doubleRequiredEva Double required
  doubleMinEva Double min(0)
  doubleMaxEva Double max(100)
  bigDecimalRequiredEva BigDecimal required
  bigDecimalMinEva BigDecimal min(0)
  bigDecimalMaxEva BigDecimal max(100)
  localDateEva LocalDate
  localDateRequiredEva LocalDate required
  instantEva Instant
  instanteRequiredEva Instant required
  zonedDateTimeEva ZonedDateTime
  zonedDateTimeRequiredEva ZonedDateTime required
  durationEva Duration
  durationRequiredEva Duration required
  booleanEva Boolean
  booleanRequiredEva Boolean required
  enumEva EnumFieldClass
  enumRequiredEva EnumRequiredFieldClass required
  uuidEva UUID
  uuidRequiredEva UUID required
  byteImageEva ImageBlob
  byteImageRequiredEva ImageBlob required
  byteImageMinbytesEva ImageBlob minbytes(0)
  byteImageMaxbytesEva ImageBlob maxbytes(10000)
  byteAnyEva AnyBlob
  byteAnyRequiredEva AnyBlob required
  byteAnyMinbytesEva AnyBlob minbytes(0)
  byteAnyMaxbytesEva AnyBlob maxbytes(10000)
  byteTextEva TextBlob
  byteTextRequiredEva TextBlob required
}
entity FieldTestPaginationEntity {
  stringAlice String
  stringRequiredAlice String required
  stringMinlengthAlice String minlength(0)
  stringMaxlengthAlice String maxlength(20)
  stringPatternAlice String pattern(/^[a-zA-Z0-9]*$/)
  integerAlice Integer
  integerRequiredAlice Integer required
  integerMinAlice Integer min(0)
  integerMaxAlice Integer max(100)
  longAlice Long
  longRequiredAlice Long required
  longMinAlice Long min(0)
  longMaxAlice Long max(100)
  floatAlice Float
  floatRequiredAlice Float required
  floatMinAlice Float min(0)
  floatMaxAlice Float max(100)
  doubleRequiredAlice Double required
  doubleMinAlice Double min(0)
  doubleMaxAlice Double max(100)
  bigDecimalRequiredAlice BigDecimal required
  bigDecimalMinAlice BigDecimal min(0)
  bigDecimalMaxAlice BigDecimal max(100)
  localDateAlice LocalDate
  localDateRequiredAlice LocalDate required
  instantAlice Instant
  instanteRequiredAlice Instant required
  zonedDateTimeAlice ZonedDateTime
  zonedDateTimeRequiredAlice ZonedDateTime required
  durationAlice Duration
  durationRequiredAlice Duration required
  booleanAlice Boolean
  booleanRequiredAlice Boolean required
  enumAlice EnumFieldClass
  enumRequiredAlice EnumRequiredFieldClass required
  uuidAlice UUID
  uuidRequiredAlice UUID required
  byteImageAlice ImageBlob
  byteImageRequiredAlice ImageBlob required
  byteImageMinbytesAlice ImageBlob minbytes(0)
  byteImageMaxbytesAlice ImageBlob maxbytes(10000)
  byteAnyAlice AnyBlob
  byteAnyRequiredAlice AnyBlob required
  byteAnyMinbytesAlice AnyBlob minbytes(0)
  byteAnyMaxbytesAlice AnyBlob maxbytes(10000)
  byteTextAlice TextBlob
  byteTextRequiredAlice TextBlob required
}
entity FieldTestServiceClassAndJpaFilteringEntity {
  stringBob String
  stringRequiredBob String required
  stringMinlengthBob String minlength(0)
  stringMaxlengthBob String maxlength(20)
  stringPatternBob String pattern(/^[a-zA-Z0-9]*$/)
  integerBob Integer
  integerRequiredBob Integer required
  integerMinBob Integer min(0)
  integerMaxBob Integer max(100)
  longBob Long
  longRequiredBob Long required
  longMinBob Long min(0)
  longMaxBob Long max(100)
  floatBob Float
  floatRequiredBob Float required
  floatMinBob Float min(0)
  floatMaxBob Float max(100)
  doubleRequiredBob Double required
  doubleMinBob Double min(0)
  doubleMaxBob Double max(100)
  bigDecimalRequiredBob BigDecimal required
  bigDecimalMinBob BigDecimal min(0)
  bigDecimalMaxBob BigDecimal max(100)
  localDateBob LocalDate
  localDateRequiredBob LocalDate required
  instantBob Instant
  instanteRequiredBob Instant required
  zonedDateTimeBob ZonedDateTime
  zonedDateTimeRequiredBob ZonedDateTime required
  durationBob Duration
  durationRequiredBob Duration required
  booleanBob Boolean
  booleanRequiredBob Boolean required
  enumBob EnumFieldClass
  enumRequiredBob EnumRequiredFieldClass required
  uuidBob UUID
  uuidRequiredBob UUID required
  byteImageBob ImageBlob
  byteImageRequiredBob ImageBlob required
  byteImageMinbytesBob ImageBlob minbytes(0)
  byteImageMaxbytesBob ImageBlob maxbytes(10000)
  byteAnyBob AnyBlob
  byteAnyRequiredBob AnyBlob required
  byteAnyMinbytesBob AnyBlob minbytes(0)
  byteAnyMaxbytesBob AnyBlob maxbytes(10000)
  byteTextBob TextBlob
  byteTextRequiredBob TextBlob required
}
entity FieldTestServiceImplEntity {
  stringMika String
  stringRequiredMika String required
  stringMinlengthMika String minlength(0)
  stringMaxlengthMika String maxlength(20)
  stringPatternMika String pattern(/^[a-zA-Z0-9]*$/)
  integerMika Integer
  integerRequiredMika Integer required
  integerMinMika Integer min(0)
  integerMaxMika Integer max(100)
  longMika Long
  longRequiredMika Long required
  longMinMika Long min(0)
  longMaxMika Long max(100)
  floatMika Float
  floatRequiredMika Float required
  floatMinMika Float min(0)
  floatMaxMika Float max(100)
  doubleRequiredMika Double required
  doubleMinMika Double min(0)
  doubleMaxMika Double max(100)
  bigDecimalRequiredMika BigDecimal required
  bigDecimalMinMika BigDecimal min(0)
  bigDecimalMaxMika BigDecimal max(100)
  localDateMika LocalDate
  localDateRequiredMika LocalDate required
  instantMika Instant
  instanteRequiredMika Instant required
  zonedDateTimeMika ZonedDateTime
  zonedDateTimeRequiredMika ZonedDateTime required
  durationMika Duration
  durationRequiredMika Duration required
  booleanMika Boolean
  booleanRequiredMika Boolean required
  enumMika EnumFieldClass
  enumRequiredMika EnumRequiredFieldClass required
  uuidMika UUID
  uuidRequiredMika UUID required
  byteImageMika ImageBlob
  byteImageRequiredMika ImageBlob required
  byteImageMinbytesMika ImageBlob minbytes(0)
  byteImageMaxbytesMika ImageBlob maxbytes(10000)
  byteAnyMika AnyBlob
  byteAnyRequiredMika AnyBlob required
  byteAnyMinbytesMika AnyBlob minbytes(0)
  byteAnyMaxbytesMika AnyBlob maxbytes(10000)
  byteTextMika TextBlob
  byteTextRequiredMika TextBlob required
}
entity EntityWithDTO {
  emma String
}
entity EntityWithServiceClassAndPagination {
  enzo String
}
entity EntityWithServiceImplAndPagination {
  hugo String
}
entity EntityWithServiceImplAndDTO {
  louis String
}
entity EntityWithPaginationAndDTO {
  lea String
}
entity EntityWithServiceClassPaginationAndDTO {
  lena String
}
entity EntityWithServiceImplPaginationAndDTO {
  theo String
}
entity MapsIdUserProfileWithDTO (maps_id_user_profile_withdto) {
  dateOfBirth Instant
}
entity FieldTestEnumWithValue (entity_with_enums) {
  myFieldA MyEnumA
  myFieldB MyEnumB
  myFieldC MyEnumC
}
entity BankAccount {
  name String required
  guid UUID
  bankNumber Integer
  agencyNumber Long
  lastOperationDuration Float
  meanOperationDuration Double
  meanQueueDuration Duration
  balance BigDecimal required
  openingDay LocalDate
  lastOperationDate Instant
  active Boolean
  accountType BankAccountType
  attachment AnyBlob
  description TextBlob
}
entity Label {
  labelName String required minlength(3)
}
enum EnumFieldClass {
  ENUM_VALUE_1,
  ENUM_VALUE_2,
  ENUM_VALUE_3
}
enum EnumRequiredFieldClass {
  ENUM_VALUE_1,
  ENUM_VALUE_2,
  ENUM_VALUE_3
}
enum MyEnumA {
  AAA,
  BBB
}
enum MyEnumB {
  AAA (aaa_aaa),
  BBB
}
enum MyEnumC {
  AAA (aaa_aaa),
  BBB (b and b)
}
enum BankAccountType {
  CHECKING,
  SAVINGS,
  LOAN
}

relationship OneToOne {
  MapsIdUserProfileWithDTO{user(login)} to User
}
relationship OneToMany {
  BankAccount{operation} to Operation{bankAccount(name)}
}
relationship ManyToOne {
  BankAccount{user(login)} to User
}
relationship ManyToMany {
  Operation{label(labelName)} to Label{operation}
}

paginate Operation, FieldTestInfiniteScrollEntity with infinite-scroll
paginate FieldTestPaginationEntity, EntityWithServiceClassAndPagination, EntityWithServiceImplAndPagination, EntityWithPaginationAndDTO, EntityWithServiceClassPaginationAndDTO, EntityWithServiceImplPaginationAndDTO, Label with pagination
clientRootFolder Operation, BankAccount, Label with test-root
dto FieldTestMapstructAndServiceClassEntity, EntityWithDTO, EntityWithServiceImplAndDTO, EntityWithPaginationAndDTO, EntityWithServiceClassPaginationAndDTO, EntityWithServiceImplPaginationAndDTO, MapsIdUserProfileWithDTO with mapstruct
service FieldTestMapstructAndServiceClassEntity, FieldTestServiceClassAndJpaFilteringEntity, EntityWithServiceClassAndPagination, EntityWithServiceClassPaginationAndDTO, Label with serviceClass
service FieldTestServiceImplEntity, EntityWithServiceImplAndPagination, EntityWithServiceImplAndDTO, EntityWithServiceImplPaginationAndDTO, MapsIdUserProfileWithDTO, BankAccount with serviceImpl
angularSuffix BankAccount with mySuffix
readOnly Label

Environment and Tools

openjdk version “17.0.1” 2021-10-19 OpenJDK Runtime Environment GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05) OpenJDK 64-Bit Server VM GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05, mixed mode, sharing)

git version 2.30.1 (Apple Git-130)

node: v14.18.1

npm: 8.1.2

Docker version 20.10.11, build dea9396

Docker Compose version v2.2.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
Tcharlcommented, Dec 14, 2021

@mraible it now works on my branch, as long as you don’t use gradle or mongo. I’ll continue to improve it to have everything green

0reactions
mraiblecommented, Feb 6, 2022

I figured out the solution to this today. You need to add @Component to Impl classes and add SimpleR2dbcRepository to type hints.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring boot upgrade from 2.6.6 to 2.7.1 - dev.miku:r2dbc-mysql
With Spring boot 2.6.6, I am using r2dbc-mysql. runtimeOnly 'dev.miku:r2dbc-mysql'. Getting compilation error after upgrading Spring boot to ...
Read more >
Resolving Failed to Configure a DataSource Error - Baeldung
In this short tutorial, we'll discuss what causes and what resolves the “Failed to configure a DataSource” error on a Spring Boot project....
Read more >
Spring Boot Reference Documentation
Try the How-to documents. They provide solutions to the most common questions. Learn the Spring basics. Spring Boot builds on many other Spring...
Read more >
Spring Boot Error - Error creating a bean with name ...
The main reason they were getting this error was because of starter dependency like some of they have included spring-boot-starter-data-jpa which then included ......
Read more >
Spring Data R2dbc · Spring WebFlux By Example - Hantsy Bai
For the newest Spring Boot 2.4 and Spring Data R2dbc 1.2, please go to Spring R2dbc Sample and update yourself to the latest...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found