grails / grails-spring-security-core

Grails Spring Security Core Plugin
Apache License 2.0
259 stars 223 forks source link

Error Application class not found #997

Open ronaldpatino opened 8 months ago

ronaldpatino commented 8 months ago

Issue description

The Plugin Version: 6.1.1 Grails Version: 6.1.1 Java: 17.0.9" 2023-10-17 LTS

  1. Add the dependency
    implementation("org.grails.plugins:spring-security-core:6.1.1")

The gradle.properties file:

grailsVersion=6.1.1
grailsGradlePluginVersion=6.1.1

Run the following command from the Command Line/Terminal (from the project root):

./gradlew runCommand "-Pargs=s2-quickstart com.package.app User Role"

Problem

| Error Application class not found

> Task :runCommand FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':runCommand'.
> Process 'command '/home/user/.sdkman/candidates/java/17.0.9-oracle/bin/java'' finished with non-zero exit value 1
jromero-onclick commented 7 months ago

Same for me

grailsVersion=6.1.1 grailsGradlePluginVersion=6.1.1 grails-spring-security-core : 6.1.1 implementation("org.grails.plugins:spring-security-core:6.1.1") Java 11.0.21-zulu

Task :runCommand FAILED | Error Application class not found

jromero-onclick commented 7 months ago

FYI, the command started to work when I have commented this dependency:

// developmentOnly("org.springframework.boot:spring-boot-devtools")

But other error appeared. I think that is not related to this issue, the command finishes with an script error:

Configuring Spring Security Core ... ... finished configuring Spring Security Core Grails application running at http://localhost:0 in environment: development Creating User class User in package com.example

Creating Role class Role in package com.example Rendered template PersonWithoutInjection.groovy.template to destination grails-app/domain/com/example/User.groovy Rendered template PersonPasswordEncoderListener.groovy.template to destination src/main/groovy/com/example/UserPasswordEncoderListener.groovy | Error Command execution error: grails-app/conf/spring/resources.groovy (No such file or directory)

puneetbehl commented 5 months ago

@ronaldpatino Can you please write step-by step instructions to either create the application and how replicate this problem? or share a sample application to start with?

This would help us to quickly resolve this problem.

digdas1 commented 1 month ago

My steps: 1: Create an application from start.grails.org (Grails 6.2.0 2: Add line to build.gradle: implementation 'org.grails.plugins:spring-security-core:6.1.1' 3: ./gradlew runCommand "-Pargs=s2-quickstart my.application User Role" -> Fails 4: mkdir grails-app/conf/spring 5: Comment out (build.gradle) developmentOnly("org.springframework.boot:spring-boot-devtools") 6: ./gradlew runCommand "-Pargs=s2-quickstart my.application User Role"

It works now 7: undo step 5.