The method getUserAuthority(java.util.Set<com.djamware.springsecuritymongodb.domain.Role>) in the type CustomUserDetailsService is not applicable for the arguments (java.util.Set<javax.management.relation.Role>) Why giving this error? This Java file is under package com.djamware.springsecuritymongodb.services and User.java is under package com.djamware.springsecuritymongodb.domain I have created User Class attached here. User.java Answer The reason is that the Role that CustomUserDetailsServices getUserAuthority(Set<Role> userRoles) is expecting com.djamware.springsecuritymongodb.domain.Role (see its imports). However, User is returning
Tag: build.gradle
unable to write the logs to log file using log4j through Gradle
I am working on Cucumber TestNg Gradle automation project. As I am new to Gradle and not able to figure the issue though I have put in appropriate log4j dependencies in build.gradle file. Can somebody look into this issue and provide the solutions or advise me on what went wrong due to which logs are not written to log file
how do I import java class in build.gradle file
I want to import static data in build.gradle file from below class: I saw a project where they used, something like: but I couldn’t figure out what configurations are to be provided in order to have the visibility of java class from build.gradle. Any help would be highly appreciated. Answer You’ll want to use buildSrc: https://docs.gradle.org/current/userguide/organizing_gradle_projects.html#sec:build_sources So for your example,
gradle javaexec error “‘apiElements’ directly is not allowed”- Gradle 5.4.1
I am new to Gradle and trying to migrate an existing system build from ant to Gradle. As part of this I need to run a java program on every file in a directory. Directory contains xml files and the java code will parse and convert .xml to .java files (and these Java files would be build to generate class
Gradle : Failed to notify build listener
When we build our application using gradle, it is throwing the exception below .Following is the build.gradle code: I am getting the below error : Build file, line: 81 Failed to notify build listener. ‘org.gradle.api.file.FileCollection org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal.getPublishableFiles()’ Can anyone help me please ? Answer For future readers who stumble upon this error. I’ve been piece mealing together a working jfrog publish
Gradle Kotlin DSL – Build script fails when java.sourceCompatibility defined in Parent but build is successful when added to child module
Am trying to setup a new repository for a multi module springBoot application using gradle (Kotlin DSL for build scripts) As part of the same I am trying to declare generic configuration and dependencies needed for all subProjects. In doing so, I am trying to define sourceCompatility for all child projects in the subprojects block of parent build.gradle.kts file When
How can I fix NoClassDefFoundError when using Spring framework’s WebSocketClient
I am writing a desktop Java application as a web service client. I want to use WebSocket to implement notification “callback” from the server. I am using the Spring framework’s WebSocketStompClient. Below snippet shows how I initialize it: It works perfectly if I run it in IntelliJ IDE, however, if I run by command line “java -cp my.jar MyPackage.MyMainClass”, it
Does gradle.properties have access to environment variables
I looked around and could not find any way of accessing environment variables in my gradle.properties. What I can do: In my build.gradle I can access environment variables like this System.getenv(“MY_VAR”). I would like to do the same in my gradle.properties. Example of what I want to do: In my gradle.properties replace build.foo=bar with build.foo=System.getenv(“BAR”) So far all my attempts
ERROR: Failed to resolve: androidx.annotation.annotation:1.1.0: Affected Modules: app
i try to add this package androidx.annotation.annotation:1.1.0 to fix some problem but i get this ERROR: Failed to resolve: androidx.annotation.annotation:1.1.0: Affected Modules: app this is my build.gradle what i can do to fix that Answer androidx.annotation.annotation:1.1.0 is not a correct dependancy declaration. The correct one is Link
NoClassDefFoundError for Gradle fat jar with tests Spring Boot
I need to create fat jar in Gradle project with tests where Main method is under src/test. Now I have Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/cli/CommandLineParser when I run fat jar created by ‘gradle bootJar’. My Gradle: My spring.xml: Exception: Previously following ‘gradle shadowJar’ code worked well until I added AspectJ to the project And error appeared on running ‘gradle