class file for com.google.android.gms.common.data.zzf not found - wear-os

I have an application with 3 modules, wear,shared and mobile where i am trying to get sensor data from wearOs like acc,gyro and stream it to mobile app. My wear module seems to work fine, however my mobile module shows this error:
for (DataEvent event : dataEvents) {
^
class file for com.google.android.gms.common.data.zzf not found
I don't know why is it so
This is my build.grade for mobile module:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.test:monitor:1.3.0'
androidTestImplementation 'junit:junit:4.12'
wearApp project(':wear')
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.gms:play-services:7.3.0'
implementation project(':shared')
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.annotation:annotation:1.0.2'
//forExampleInstrumentTest
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'org.tensorflow:tensorflow-lite:+'
implementation 'org.tensorflow:tensorflow-android:1.8.0'
implementation("com.tbuonomo:dotsindicator:4.3")
implementation platform('com.google.firebase:firebase-bom:31.0.2')
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-auth:20.4.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.4'
}

Related

Could not find org.projectlombok:lombok:1.18.22. error (lombok)

I've installed the lombok plugin from marketplace and enabled it.
I've also enabled annotations processor.
Here are the list of dependencies that I find in my build.gradle file :
dependencies {
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.projectlombok:lombok:1.18.22'
implementation 'org.projectlombok:lombok:1.18.22'
}
Also this one -
buildscript {
apply plugin: 'brazil-gradle'
dependencies {
classpath brazilGradle.tool('BrazilGradleQualityDefaults')
}
I've defined #Builder annotation on a class an I find - Cannot resolve symbol 'Builder' . When I clicked on - Add lombok to class path. I'm getting the following error -
Could not find org.projectlombok:lombok:1.18.22.
Required by:
project :
Am I missing on something? Any help would be really appreciated.

Upgrade from oracle-r2dbc version 0.4.0 to 1.0.0 is resulting in class cast exception while update

I was trying to upgrade R2DBC from 0.4.0 to 1.0.0.
while doing that I am getting error in update which was working fine in version 0.4.0.
Build.gradle that I am using
plugins {
id 'org.springframework.boot' version '2.7.2'
id 'io.spring.dependency-management' version '1.0.12.RELEASE'
id 'java'
}
group = '<group>'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
maven {
url "https://nexus/repository/maven-public/"
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
implementation ('org.springframework.boot:spring-boot-starter-actuator:2.7.4') {
exclude group: 'org.springframework.boot', module: 'spring-boot'
}
implementation 'org.springframework.boot:spring-boot:2.7.4'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa:2.7.4'
implementation ('org.springframework.boot:spring-boot-starter-data-r2dbc:2.7.4') {
exclude group: 'io.r2dbc', module: 'r2dbc-spi'
exclude group: 'io.r2dbc', module: 'r2dbc-pool'
exclude group: 'org.springframework.data', module: 'spring-data-r2dbc'
exclude group: 'io.projectreactor', module: 'reactor-core'
exclude group: 'org.springframework.boot', module: 'spring-boot-starter'
}
implementation 'io.r2dbc:r2dbc-spi:1.0.0.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter:2.7.4'
implementation ('io.r2dbc:r2dbc-pool:1.0.0.RC1') {
exclude group: 'io.projectreactor', module: 'reactor-core'
}
implementation ('org.springframework.data:spring-data-r2dbc:1.5.3') {
exclude group: 'org.springframework', module: 'spring-r2dbc'
exclude group: 'io.r2dbc', module: 'r2dbc-spi'
exclude group: 'io.projectreactor', module: 'reactor-core'
exclude group: 'org.springframework.data', module: 'spring-data-commons'
exclude group: 'org.springframework.data', module: 'spring-data-relational'
exclude group: 'org.springframework', module: 'spring-tx'
exclude group: 'org.springframework', module: 'spring-context'
exclude group: 'org.springframework', module: 'spring-beans'
exclude group: 'org.springframework', module: 'spring-core'
}
implementation 'org.springframework.data:spring-data-commons:2.7.3'
implementation 'org.springframework.data:spring-data-relational:2.4.3'
implementation 'org.springframework:spring-tx:5.3.23'
implementation 'org.springframework:spring-context:5.3.23'
implementation 'org.springframework:spring-beans:5.3.23'
implementation 'org.springframework:spring-core:5.3.23'
implementation ('org.springframework:spring-r2dbc:5.3.23') {
exclude group: 'io.r2dbc', module: 'r2dbc-spi'
exclude group: 'io.projectreactor', module: 'reactor-core'
}
implementation 'io.projectreactor:reactor-core:3.4.23'
implementation ('com.oracle.database.r2dbc:oracle-r2dbc:1.0.0') {
exclude group: 'com.oracle.database.jdbc', module: 'ojdbc11'
exclude group: 'io.projectreactor', module: 'reactor-core'
}
implementation ('org.springframework.boot:spring-boot-starter-webflux') {
exclude group: 'io.projectreactor', module: 'reactor-core'
exclude group: 'org.springframework.boot', module: 'spring-boot-starter'
}
implementation files('./lib/eagle_commons-0.0.1-SNAPSHOT-plain.jar')
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
implementation ('sg.com.gic:crypto-lib:1.0.5') {
exclude group: 'slf4j', module: 'slf4j-api'
exclude group: 'ch.qos.logback', module: 'logback-core'
exclude group: 'ch.qos.logback', module: 'logback-classic'
}
implementation group: 'com.oracle.database.jdbc', name: 'ojdbc11', version: '21.7.0.0'
implementation group: 'org.springdoc', name: 'springdoc-openapi-webflux-ui', version: '1.6.11'
implementation group: 'org.modelmapper', name: 'modelmapper', version: '3.1.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
}
tasks.named('test') {
useJUnitPlatform()
}
Below is the SQL Update Query from R2dbcRepository Repository:
#Modifying
#Query(value = "UPDATE <Table_name> SET PARAM_VALUE=:paramValue WHERE BATCH_ID=:batchId and PARAM_NAME=:paramName")
Mono<Integer> updateODADateParam(String paramValue, String batchId, String paramName);
Error Log:
2022-10-05 09:47:37,080 DEBUG [ForkJoinPool.commonPool-worker-3] org.springframework.r2dbc.core.DefaultDatabaseClient$DefaultGenericExecuteSpec: Executing SQL statement [UPDATE <table_name> SET PARAM_VALUE=:P0_paramValue WHERE BATCH_ID=:P1_batchId and PARAM_NAME=:P2_paramName]
2022-10-05 09:47:37,121 ERROR [ForkJoinPool.commonPool-worker-7] com.gic.eagle.txnHld.handler.RESIBatchDateHandler: Error [class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')]
java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
at java.base/java.util.stream.Collectors.lambda$summingInt$19(Collectors.java:673)
at reactor.core.publisher.MonoStreamCollector$StreamCollectorSubscriber.onNext(MonoStreamCollector.java:132)
at reactor.core.publisher.FluxFlatMap$FlatMapMain.tryEmit(FluxFlatMap.java:543)
at reactor.core.publisher.FluxFlatMap$FlatMapInner.onNext(FluxFlatMap.java:984)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)
at reactor.core.publisher.FluxConcatArray$ConcatArrayDelayErrorSubscriber.onNext(FluxConcatArray.java:364)
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onNext(FluxFilterFuseable.java:118)
at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onNext(FluxMapFuseable.java:299)
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2398)
at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.request(FluxMapFuseable.java:360)
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.request(FluxFilterFuseable.java:191)
at reactor.core.publisher.FluxConcatArray$ConcatArrayDelayErrorSubscriber.request(FluxConcatArray.java:461)
at reactor.core.publisher.FluxPeek$PeekSubscriber.request(FluxPeek.java:138)
at reactor.core.publisher.FluxFlatMap$FlatMapInner.onSubscribe(FluxFlatMap.java:964)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onSubscribe(FluxPeek.java:171)
at reactor.core.publisher.FluxConcatArray$ConcatArrayDelayErrorSubscriber.onSubscribe(FluxConcatArray.java:350)
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onSubscribe(FluxFilterFuseable.java:87)
at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onSubscribe(FluxMapFuseable.java:265)
at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55)
at reactor.core.publisher.Flux.subscribe(Flux.java:8466)
at reactor.core.publisher.FluxConcatArray$ConcatArrayDelayErrorSubscriber.onComplete(FluxConcatArray.java:443)
at reactor.core.publisher.FluxConcatArray.subscribe(FluxConcatArray.java:73)
at reactor.core.publisher.Flux.subscribe(Flux.java:8466)
at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:426)
at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onNext(FluxUsingWhen.java:345)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onNext(FluxConcatArray.java:201)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2398)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onSubscribeInner(MonoFlatMapMany.java:150)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:189)
at reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:172)
at oracle.r2dbc.impl.AsyncLock.lambda$get$2(AsyncLock.java:167)
at oracle.r2dbc.impl.AsyncLock.unlock(AsyncLock.java:125)
at oracle.r2dbc.impl.AsyncLock$UsingConnectionSubscriber.terminate(AsyncLock.java:516)
at oracle.r2dbc.impl.AsyncLock$UsingConnectionSubscriber.onComplete(AsyncLock.java:502)
at reactor.core.publisher.StrictSubscriber.onComplete(StrictSubscriber.java:123)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2058)
at org.reactivestreams.FlowAdapters$FlowToReactiveSubscriber.onComplete(FlowAdapters.java:221)
at oracle.jdbc.internal.CompletionStageUtil$IteratorSubscription.emitComplete(CompletionStageUtil.java:804)
at oracle.jdbc.internal.CompletionStageUtil$IteratorSubscription.emitItems(CompletionStageUtil.java:751)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Originally raised the issue here:
https://github.com/oracle/oracle-r2dbc/issues/97
Got the information from Oracle team that the issue could be same as
https://github.com/oracle/oracle-r2dbc/issues/89
If anybody can point out what is wrong with dependency version, would be helpful.
Thanks
Don't mess around with overrides and manually managing your dependencies. That will only lead to issues. Also using Spring Data R2DBC is tied to specific versions of R2DBC so you cannot simply upgrade, you have to wait for a version that supports that specific version.
If you want to override versions follow the documented approach instead of all the excludes and overrides.
plugins {
id 'org.springframework.boot' version '2.7.4'
id 'io.spring.dependency-management' version '1.0.12.RELEASE'
id 'java'
}
group = '<group>'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
maven {
url "https://nexus/repository/maven-public/"
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
ext['oracle-database.version']='21.7.0.0'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-r2dbc'
implementation 'com.oracle.database.r2dbc:oracle-r2dbc'
implementation files('./lib/eagle_commons-0.0.1-SNAPSHOT-plain.jar')
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
implementation 'sg.com.gic:crypto-lib:1.0.5'
implementation group: 'com.oracle.database.jdbc', name: 'ojdbc11'
implementation group: 'org.springdoc', name: 'springdoc-openapi-webflux-ui', version: '1.6.11'
implementation group: 'org.modelmapper', name: 'modelmapper', version: '3.1.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
}
tasks.named('test') {
useJUnitPlatform()
}
This will fix all the excludes and incompatible versions. You cannot use R2DBC 1.0.0 with Spring BOot 2.7 (AFAIK) you would need to upgrade to Spring Boot 3.0.0 (as that includes the proper Spring Data version and R2DBC version which isn't compatible with Spring Boot 2.7 as it requires Spring Framework 6, java 17 etc.).
If you want to upgrade, modify the Spring Boot plugin version and everything else should be included automatically.
R2dbc 1.0.0 introduces several breaking changes, esp. some aggregate functions, eg. count returns Long instead of Integer.
I do not think the Spring Boot 2.7.x managed Spring Data R2dbc is ready for R2dbc 1.0.0. The latest Spring Data R2dbc(aligned to R2dbc 1.0.0) is upgraded to Spring Boot 3.0 code base.
Keep to use Spring Boot 2.7.5 and built-in Spring Data R2dbc.
if you want to use the latest R2dbc 1.0.0, consider Spring Boot 3.0.0-RC2, Spring Boot 3.0 is close to GA status.

org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class cannot be opened because it does not exist

I have this gradle configuration with the following dependencies:
plugins {
id 'org.springframework.boot' version '2.6.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = '......'
version = '0.0.1'
sourceCompatibility = '11'
ext {
set('springCloudVersion', "2021.0.1")
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
implementation 'org.springframework.cloud:spring-cloud-starter-loadbalancer'
implementation 'org.codehaus.jettison:jettison:1.4.1'
implementation 'com.netflix.eureka:eureka-core'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'javax.validation:validation-api'
implementation 'org.hibernate.validator:hibernate-validator'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.threeten:threetenbp:1.5.1'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'joda-time:joda-time:2.10.13'
implementation 'org.springframework.security:spring-security-core'
implementation 'org.apache.commons:commons-lang3:3.8.1'
implementation 'org.apache.commons:commons-collections4:4.4'
implementation 'org.json:json:20211205'
implementation 'org.springframework.boot:spring-boot-starter-hateoas'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.13.1'
implementation 'org.springframework.amqp:spring-amqp'
implementation 'org.springframework.amqp:spring-rabbit'
implementation 'io.jsonwebtoken:jjwt:0.9.1'
implementation 'org.parboiled:parboiled-core:1.4.0'
implementation 'commons-validator:commons-validator:1.7'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'org.springframework:spring-oxm'
implementation 'org.springframework.ws:spring-ws-core'
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
testCompileOnly 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
runtimeOnly 'org.postgresql:postgresql'
implementation group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0'
implementation 'org.liquibase:liquibase-core'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
test {
useJUnitPlatform()
}
When I start the application I get this error:
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class] cannot be opened because it does not exist
Do you know what dependency should be added or some dependency is missing?
P.S
The problem comes form this dependency:
implementation 'org.springframework.cloud:spring-cloud-starter-hystrix:1.4.7.RELEASE'
implementation group: 'com.netflix.hystrix', name: 'hystrix-core', version: '1.5.18'
Do you know how I can fix it?
I think you question has been already answered; please, consider review this SO question.
You need to include the following dependency:
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-hystrix:2.2.10.RELEASE'
Because you are using Spring BOM maybe this will be enough:
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-hystrix'

Execution optimizations have been disabled for task ':compileGsonViews'

We recently upgraded our project from Grails 3 to 5.1.1. Actually, it was not really an upgrade but rather a migration. We ended up creating a fresh project with 5.1.1 and migrated all of our code into it. Everything is currently working with an exception of one warning:
> Task :compileGsonViews
Execution optimizations have been disabled for task ':compileGsonViews' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: '/Users/shurikag/PRIZ/dev/priz-api/build/gson-classes/main'. Reason: Task ':bootWarMainClassName' uses this output of task ':compileGsonViews' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
And in fact, as our newrelic shows, the app is now extremely slow on gson rendering. Usually the first time an endpoint is called, it is very slow, the subsequent calls are OK.
Is there a solution for it?
Here is our build.gradle:
buildscript {
repositories {
maven {
url "https://repo.grails.org/grails/core"
}
maven {
url "https://repo.grails.org/artifactory/core"
}
mavenCentral()
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "org.grails.plugins:hibernate5:7.2.0"
classpath "org.grails.plugins:views-gradle:2.1.2"
classpath "gradle.plugin.com.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:2.6"
classpath 'org.grails.plugins:database-migration:3.1.0'
}
}
version "0.1"
group "priz.api"
apply plugin: "eclipse"
apply plugin: "idea"
// apply plugin:"visual-studio"
apply plugin: "war"
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.plugins.views-json"
apply plugin: "com.github.erdi.webdriver-binaries"
repositories {
maven {
url "https://repo.grails.org/grails/core"
}
maven {
url "https://repo.grails.org/artifactory/core"
}
mavenCentral()
}
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
dependencies {
implementation platform('com.amazonaws:aws-java-sdk-bom:1.11.1000')
implementation 'com.amazonaws:aws-java-sdk-s3'
developmentOnly("org.springframework.boot:spring-boot-devtools")
compileOnly "io.micronaut:micronaut-inject-groovy"
// https://mvnrepository.com/artifact/io.micronaut/micronaut-core
implementation 'io.micronaut:micronaut-core:3.2.6'
console "org.grails:grails-console"
implementation "org.springframework.boot:spring-boot-starter-logging:2.6.2"
implementation "org.springframework.boot:spring-boot-starter-validation:2.6.2"
implementation "org.springframework.boot:spring-boot-autoconfigure:2.6.2"
implementation "org.grails:grails-core"
implementation "org.springframework.boot:spring-boot-starter-actuator:2.6.2"
implementation "org.springframework.boot:spring-boot-starter-tomcat:2.6.2"
implementation "org.grails:grails-plugin-url-mappings"
implementation "org.grails:grails-plugin-rest"
implementation "org.grails:grails-plugin-codecs"
implementation "org.grails:grails-plugin-interceptors"
implementation "org.grails:grails-plugin-services"
implementation "org.grails:grails-plugin-datasource"
implementation "org.grails:grails-plugin-databinding"
implementation "org.grails:grails-web-boot"
implementation "org.grails:grails-logging"
implementation "org.grails.plugins:cache"
implementation "org.grails.plugins:async"
implementation "org.grails.plugins:events"
implementation "org.grails.plugins:hibernate5"
implementation "org.hibernate:hibernate-core:5.6.3.Final"
implementation 'org.hibernate:hibernate-ehcache:5.6.3.Final'
implementation "org.grails.plugins:views-json:2.1.2"
implementation "org.grails.plugins:views-json-templates:2.1.2"
profile "org.grails.profiles:rest-api"
runtimeOnly "org.glassfish.web:el-impl:2.2.1-b05"
runtimeOnly "com.h2database:h2"
runtimeOnly "org.apache.tomcat:tomcat-jdbc"
runtimeOnly "javax.xml.bind:jaxb-api:2.3.1"
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.mockito:mockito-core"
testImplementation "io.micronaut:micronaut-http-client"
testImplementation "org.grails:grails-web-testing-support"
testImplementation "org.grails:views-json-testing-support"
testImplementation "org.hibernate.validator:hibernate-validator:6.1.7.Final"
testImplementation "org.grails.plugins:geb"
testImplementation "org.seleniumhq.selenium:selenium-remote-driver:4.0.0"
testImplementation "org.seleniumhq.selenium:selenium-api:4.0.0"
testImplementation "org.seleniumhq.selenium:selenium-support:4.0.0"
testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:4.0.0"
testRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:4.0.0"
runtimeOnly "org.grails.plugins:async:4.0.0"
implementation 'org.grails.plugins:postgresql-extensions:7.0.0'
implementation "org.postgresql:postgresql:42.3.1"
implementation 'org.grails.plugins:database-migration:3.1.0'
implementation 'org.liquibase:liquibase-core:3.10.3'
implementation "org.grails.plugins:spring-security-core:4.0.3"
implementation "org.grails.plugins:spring-security-rest:3.0.1"
implementation 'com.auth0:auth0:1.35.0'
implementation 'com.auth0:jwks-rsa:0.20.0'
implementation 'com.sendinblue:sib-api-v3-sdk:5.2.0'
implementation 'com.papertrailapp:logback-syslog4j:1.0.0'
implementation "com.stripe:stripe-java:17.11.0"
implementation "org.grails:grails-datastore-gorm-async"
implementation 'org.quartz-scheduler:quartz:2.3.2'
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'co.elastic.clients:elasticsearch-java:7.16.2'
implementation 'jakarta.json:jakarta.json-api:2.0.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3'
}
sourceSets {
main {
resources {
srcDir 'grails-app/migrations'
}
}
}
bootRun {
ignoreExitValue true
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
tasks.withType(GroovyCompile) {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Xmx1024m']
}
}
tasks.withType(Test) {
useJUnitPlatform()
}
webdriverBinaries {
chromedriver '2.45.0'
geckodriver '0.30.0'
}
tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
systemProperty "webdriver.chrome.driver", System.getProperty('webdriver.chrome.driver')
systemProperty "webdriver.gecko.driver", System.getProperty('webdriver.gecko.driver')
}
UPDATE
Steps to reproduce on a freshly made project
~/PRIZ/dev $ grails -v
| Grails Version: 5.1.1
| JVM Version: 11.0.12
~/PRIZ/dev $ grails create-app myapp --profile=rest-api
| Application created at /Users/shurikag/PRIZ/dev/myapp
~/PRIZ/dev $ cd myapp
~/PRIZ/dev/myapp $ ./gradlew assemble
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :compileGroovy
09:32:41.216 [/127.0.0.1:57662 to /127.0.0.1:57661 workers] DEBUG io.micronaut.core.optim.StaticOptimizations - No optimizations class io.micronaut.core.io.service.SoftServiceLoader$Optimizations found
09:32:41.826 [/127.0.0.1:57662 to /127.0.0.1:57661 workers] DEBUG io.micronaut.core.optim.StaticOptimizations - No optimizations class io.micronaut.core.reflect.ClassUtils$Optimizations found
09:32:42.282 [/127.0.0.1:57662 to /127.0.0.1:57661 workers] DEBUG io.micronaut.core.optim.StaticOptimizations - No optimizations class io.micronaut.core.util.EnvironmentProperties found
> Task :compileGsonViews
Execution optimizations have been disabled for task ':compileGsonViews' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: '/Users/shurikag/PRIZ/dev/myapp/build/gson-classes/main'. Reason: Task ':bootWarMainClassName' uses this output of task ':compileGsonViews' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
09:32:44.382 [main] DEBUG io.micronaut.core.optim.StaticOptimizations - No optimizations class io.micronaut.core.reflect.ClassUtils$Optimizations found
09:32:44.388 [main] DEBUG io.micronaut.core.optim.StaticOptimizations - No optimizations class io.micronaut.core.util.EnvironmentProperties found
09:32:45.040 [pool-1-thread-2] DEBUG io.micronaut.core.optim.StaticOptimizations - No optimizations class io.micronaut.core.io.service.SoftServiceLoader$Optimizations found
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
UPDATE
If I update grailsGradlePluginVersion to 5.1.1 and run the app with grails run-app, I am facing another issue:
| Running application...
<=============> 100% EXECUTING [16s]
> IDLE
Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
ch.qos.logback.core.LogbackException: Unexpected filename extension of file [file:/Users/shurikag/PRIZ/dev/priz-api/grails-app/conf/logback.groovy]. Should be either .groovy or .xml
at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:67)
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:140)
at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:290)
I managed to get the error to go away. All I needed to do it all the dependency config for the related tasks (in build.gradle):
tasks.named('bootWarMainClassName') {
it.mustRunAfter(tasks.named('compileGsonViews'))
}
However, that sis not help the performance :(
I had the same error, upgrading to grails 5.1.2 results in the error still logging out but no longer causes it to actually fail

Spring Cloud Stream Configuration classes are not being loaded

After updating from Spring Boot 2.0.6 / Spring Cloud Finchley.RELEASE to Spring Boot 2.1.3 / Spring Cloud Greenwich.SR1, I am experiencing a very odd configuration / component scanning issue.
The application is structured as follows:
main-application
messaging-lib
commons-lib
Main application is annotated with #SpringBootApplication(scanBasePackages = {"com.app.libs", "com.app"}), where the com.app packages are those under the main-application, while com.app.libs are the packages of the libs.
The commons-lib configuration which is simply a framework-esque library has the following main configuration entrypoint:
package com.app.libs.commons
#Target(ElementType.TYPE)
#Retention(RetentionPolicy.RUNTIME)
#Documented
#Inherited
#Import(CommonsConfiguration.class)
public #interface EnableCommons {
}
With CommonsConfiguration having:
package com.app.libs.commons.config
#Configuration
#ConditionalOnProperty(value = "com.app.config.commons", matchIfMissing = true)
#ComponentScan(basePackages = "com.app.libs.commons")
public class FrameworkConfiguration {
This way, I can basically annotate a single configuration class in my main-application and have it pick up common beans.
The messaging-lib configuration which uses Spring Cloud Stream has the following configurations:
#Configuration
#Import({ CustomBinding.class })
#PropertySource("classpath:kafka.properties")
#EnableBinding(Source.class)
#EnableAutoConfiguration
public class BindingConfiguration {
}
The cloud stream configuration is as follows:
spring.cloud.stream.bindings.output.destination=${spring.application.name}
spring.cloud.stream.kafka.bindings.output.producer.sync=true
spring.cloud.stream.default.group=${spring.application.name}
spring.cloud.stream.default.producer.partitionCount=9
spring.cloud.stream.default.producer.partitionKeyExpression=headers.entityId
spring.cloud.stream.kafka.binder.autoAddPartitions=true
spring.cloud.stream.kafka.binder.autoCreateTopics=false
When starting the application, the following error message is produced:
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'spring.cloud.stream.default.producer.partition-key-expression' to org.springframework.expression.Expression:
Property: spring.cloud.stream.default.producer.partitionkeyexpression
Value: headers.entityId
Origin: "spring.cloud.stream.default.producer.partitionKeyExpression" from property source "class path resource [kafka.properties]"
Reason: No converter found capable of converting from type [java.lang.String] to type [#com.fasterxml.jackson.databind.annotation.JsonSerialize org.springframework.expression.Expression]
Action:
Update your application's configuration
After some looking through the source code, I've noticed that the SpelConverter in question is the one that is supposed to be initialized in SpelExpressionConverterConfiguration. Indeed, if I add #Import({ SpelExpressionConverterConfiguration.class }) or #Import({ BindingServiceConfiguration }) (the #Configuration class that imports the SpelExpressionConverterConfiguration) to my BindingConfiguration, the converter seems to get initialized. However, another error is then produced:
***************************
APPLICATION FAILED TO START
***************************
Description:
A component required a bean of type 'org.springframework.messaging.core.DestinationResolver' that could not be found.
The following candidates were found but could not be injected:
- Bean method 'binderAwareChannelResolver' in 'BindingServiceConfiguration' not loaded because #ConditionalOnBean (types: org.springframework.cloud.stream.binder.BinderTypeRegistry; SearchStrategy: current) did not find any beans of type org.springframework.cloud.stream.binder.BinderTypeRegistry
Action:
Consider revisiting the entries above or defining a bean of type 'org.springframework.messaging.core.DestinationResolver' in your configuration.
I'm not quite sure what seems to be going on. When debugging, it seems that both BindingBeansRegistrar and BinderFactoryConfiguration (the classes imported through #EnableBinding) are loaded - yet no scanning occurs and the rest of the component scanning simply does not seem to happen.
I've tried importing the configuration classes and/or scanning the packages myself, but in both cases I am still missing the DestinationResolver bean, although it should have been initialized.
I've noted that, prior to the update, there were also some issues: I had to import BindingServiceConfiguration, BinderFactoryConfiguration, and SpelExpressionConverterConfiguration manually as well.
Would anybody have pointers as to what could be causing this issue?
EDIT: Here are the build.grade files (some includes are omitted for brevity):
Application build.gradle
apply from: new File(project(':scripts').projectDir, '/service-impl.gradle')
dependencies {
implementation project(':dependency-A')
implementation project(':dependency-B')
implementation project(':messaging-library')
testImplementation 'org.springframework.cloud:spring-cloud-stream-test-support'
}
service-impl.gradle contents:
buildscript {
apply from: new File(project(':buildscripts').projectDir, '/repositories.gradle') // Repository definitions
apply from: new File(project(':buildscripts').projectDir, '/dm-boot.gradle') // DM via spring boot plugin
apply from: new File(project(':buildscripts').projectDir, '/dm-versions.gradle') // DM versions
}
configurations {
all*.exclude module: 'spring-boot-starter-tomcat'
all*.exclude group: 'org.apache.bval'
}
artifacts {
archives bootJar
}
dependencies {
compileOnly 'org.projectlombok:lombok'
compile 'org.springframework.boot:spring-boot-starter'
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-jetty'
compile 'org.springframework.boot:spring-boot-starter-actuator'
compile 'org.springframework.boot:spring-boot-starter-cache'
compile 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
compile 'org.springframework.cloud:spring-cloud-starter-config'
testCompile 'junit:junit'
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompileOnly 'org.projectlombok:lombok'
compile 'net.logstash.logback:logstash-logback-encoder'
}
Commons Library build.gradle
apply from: new File(project(':buildscripts').projectDir, '/repositories.gradle') // Repository definitions
apply from: new File(project(':buildscripts').projectDir, '/dm-plain.gradle') // DM via spring boot plugin
apply from: new File(project(':buildscripts').projectDir, '/dm-versions.gradle') // DM versions
dependencies {
api 'com.restfb:restfb:2.3.0'
api 'commons-io:commons-io'
implementation 'com.jcraft:jsch:0.1.54'
//lombok
compileOnly 'org.projectlombok:lombok'
//spring
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-jetty'
implementation 'org.springframework.boot:spring-boot-starter-security'
api 'org.springframework.security:spring-security-core'
api 'org.springframework.security:spring-security-web'
api 'org.springframework:spring-jdbc'
api 'org.springframework.boot:spring-boot-starter-actuator'
//thrift modules
compileOnly 'com.facebook.swift:swift-codec'
compileOnly 'com.facebook.swift:swift-service'
//db modules
api 'org.postgresql:postgresql'
api 'org.flywaydb:flyway-core'
api 'com.zaxxer:HikariCP'
api 'org.jooq:jooq'
//embedded pg modules
compileOnly 'com.opentable.components:otj-pg-embedded'
api group: 'net.minidev', name: 'json-smart', version: '2.2.1'
api group: 'org.json', name: 'json', version: '20140107'
//tests
testImplementation 'junit:junit'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'com.opentable.components:otj-pg-embedded'
testImplementation 'org.springframework.security:spring-security-core'
testImplementation 'org.springframework.security:spring-security-web'
testImplementation 'org.springframework.security:spring-security-config'
testImplementation 'org.springframework:spring-jdbc'
testImplementation 'org.springframework.boot:spring-boot-starter-actuator'
testImplementation 'org.apache.sshd:sshd-core:1.7.0' // sftpFileTransfer testing - embedded sftp server
testCompileOnly 'org.projectlombok:lombok'
testCompileOnly 'javax.servlet:javax.servlet-api'
}
Messaging Lib build.gradle (used as a standalone lib, hence does not use the above .gradle files)
buildscript {
ext {
springBootVersion = '2.1.3.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply from: new File(rootDir.parentFile, 'buildscripts/publish.gradle')
apply from: new File(rootDir.parentFile, 'buildscripts/coverage.gradle')
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.app.libs.messaging'
version = '0.0.3'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
ext {
springCloudVersion = 'Greenwich.SR1'
jacksonVersion = '2.9.6'
lombokVersion = '1.16.18'
jooqVersion = '3.11.2'
flywayVersion = '5.2.1'
}
dependencies {
compile 'org.aspectj:aspectjweaver'
compile 'org.springframework:spring-tx'
compile 'org.springframework.cloud:spring-cloud-stream'
compile 'org.springframework.cloud:spring-cloud-stream-binder-kafka'
compile 'org.apache.commons:commons-lang3:3.5'
compile 'org.javassist:javassist:3.22.0-GA'
compile "org.flywaydb:flyway-core:${flywayVersion}"
compileOnly "org.jooq:jooq:${jooqVersion}"
compileOnly "org.projectlombok:lombok:${lombokVersion}"
testCompileOnly "org.projectlombok:lombok:${lombokVersion}"
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile 'org.springframework.boot:spring-boot-starter-json'
testCompile 'org.springframework.cloud:spring-cloud-stream-test-support'
testCompile "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
testCompile "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
testCompile 'junit:junit:4.12'
testCompile "org.jooq:jooq:${jooqVersion}"
testCompile "org.flywaydb:flyway-core:${flywayVersion}"
testCompile 'org.postgresql:postgresql:42.2.2'
testCompile 'com.opentable.components:otj-pg-embedded:0.13.0'
testCompile 'org.springframework:spring-jdbc'
}
dependencyManagement {
// disable maven exclusion to enhance gradle import performance
// https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/153
applyMavenExclusions = false
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
jar.enabled = true
bootJar.enabled = false
I've tried to omit any files that I think should be unrelated.

Resources