0

below is my build.gradle


plugins {
 id 'org.springframework.boot' version '2.7.5'
 id 'io.spring.dependency-management' version '1.0.15.RELEASE'
 id 'java'
 id 'eclipse'
 id 'jacoco'
 id 'org.sonarqube' version "3.3"
 id 'com.google.cloud.tools.jib' version "${jibVersion}"
}
group = 'com.vsi.postgrestoattentive'
if (!project.hasProperty('buildName')) {
 throw new GradleException("Usage for CLI:" 
 + System.getProperty("line.separator") 
 + "gradlew <taskName> -Dorg.gradle.java.home=<java-home-dir> -PbuildName=<major>.<minor>.<buildNumber> -PgcpProject=<gcloudProject>"
 + System.getProperty("line.separator")
 + "<org.gradle.java.home> - OPTIONAL if available in PATH"
 + System.getProperty("line.separator")
 + "<buildName> - MANDATORY, example 0.1.23")
 + System.getProperty("line.separator")
 + "<gcpProject> - OPTIONAL, project name in GCP";
}
project.ext {
 buildName = project.property('buildName');
}
version = "${project.ext.buildName}"
sourceCompatibility = '1.8'
apply from: 'gradle/sonar.gradle'
apply from: 'gradle/tests.gradle'
apply from: 'gradle/image-build-gcp.gradle'
repositories {
 mavenCentral()
 
}
dependencies {
 implementation("org.springframework.boot:spring-boot-starter-web:${springBootVersion}")
 implementation("org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}")
 implementation 'org.springframework.boot:spring-boot-starter-web:2.7.0'
 developmentOnly 'org.springframework.boot:spring-boot-devtools'
 testImplementation 'org.springframework.boot:spring-boot-starter-test'
 testImplementation 'org.springframework.integration:spring-integration-test'
 testImplementation 'org.springframework.batch:spring-batch-test:4.3.0'
 implementation("org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}")
 implementation 'org.postgresql:postgresql:42.1.4'
 implementation 'org.springframework.batch:spring-batch-core:4.1.1.RELEASE'
 implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.1'
 implementation group: 'io.micrometer', name: 'micrometer-registry-datadog', version: '1.7.0'
 
}
bootJar {
 archiveFileName = "${project.name}.${archiveExtension.get()}"
}
springBoot {
 buildInfo()
}
test {
 finalizedBy jacocoTestReport
}
jacoco {
 toolVersion = "0.8.8"
}
jacocoTestReport {
 dependsOn test
}

We use javax.persistence.Tuple in our code for fetching data from postgres.It works fine but as soon as i change springboot version from '2.7.5' to '2.3.4.RELEASE' i get following error

java.lang.IllegalArgumentException: Invoked method public abstract java.lang.Object javax.persistence.Tuple.get(java.lang.String) is no accessor method! at org.springframework.data.projection.Accessor.(Accessor.java:50) ~[spring-data-commons-2.3.4.RELEASE.jar!/:2.3.4.RELEASE]

Can someone please help me out here?

Mahmoud Ben Hassine
32.1k5 gold badges38 silver badges67 bronze badges
asked Jan 20, 2023 at 12:28
2
  • Sounds like a bug that was fixed in some in-between spring version. If everything works with 2.7.5, is there a reason you want to downgrade to an earlier version? Commented Jan 20, 2023 at 12:37
  • i want to use env variables in kubernetes and it works properly in 2.3.4.RELEASE Commented Jan 20, 2023 at 13:00

1 Answer 1

0

Update Javax to Jakarta, that works for me.

answered Jan 24, 2024 at 13:17
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.