grails / grails-spring-security-core

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

springSecurityService not found in UserPasswordEncoderListener #542

Closed ashubits11 closed 6 years ago

ashubits11 commented 6 years ago

image

Gradle file I am using

`buildscript { repositories { mavenLocal() maven { url "https://repo.grails.org/grails/core" } } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsVersion" classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}" classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.6" classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.8" } }

version "0.1" group "some"

apply plugin:"eclipse" apply plugin:"idea" apply plugin:"war" apply plugin:"org.grails.grails-web" apply plugin:"asset-pipeline" apply plugin:"org.grails.grails-gsp"

repositories { mavenLocal() maven { url "https://repo.grails.org/grails/core" } maven { url 'http://dl.bintray.com/agorapulse/libs' } }

dependencies { assets "com.bertramlabs.plugins:less-asset-pipeline:2.14.6" compile "org.springframework.boot:spring-boot-starter-logging" compile "org.springframework.boot:spring-boot-autoconfigure" compile "org.grails:grails-core" compile "org.springframework.boot:spring-boot-starter-actuator" compile "org.springframework.boot:spring-boot-starter-tomcat" compile "org.grails:grails-web-boot" compile "org.grails:grails-logging" compile "org.grails:grails-plugin-rest" compile "org.grails:grails-plugin-databinding" compile "org.grails:grails-plugin-i18n" compile "org.grails:grails-plugin-services" compile "org.grails:grails-plugin-url-mappings" compile "org.grails:grails-plugin-interceptors" compile "org.grails.plugins:cache" compile "org.grails.plugins:async" compile "org.grails.plugins:scaffolding" compile "org.grails.plugins:events" compile "org.grails.plugins:hibernate5" compile "org.hibernate:hibernate-core:5.1.5.Final" compile "org.grails.plugins:gsp" console "org.grails:grails-console" compile 'org.grails.plugins:spring-security-core:3.2.1' compile 'org.grails.plugins:aws-sdk-s3:2.2.2' profile "org.grails.profiles:web" runtime "org.glassfish.web:el-impl:2.1.2-b03" runtime "com.h2database:h2" runtime "org.apache.tomcat:tomcat-jdbc" runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.14.6" runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.14.8" testCompile "org.grails:grails-gorm-testing-support" testCompile "org.grails:grails-web-testing-support" testCompile "org.grails.plugins:geb:1.1.2" testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:2.47.1" testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1" testRuntime "net.sourceforge.htmlunit:htmlunit:2.18" }

bootRun { jvmArgs('-Dspring.output.ansi.enabled=always') addResources = true String springProfilesActive = 'spring.profiles.active' systemProperty springProfilesActive, System.getProperty(springProfilesActive) }

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') }

assets { minifyJs = true minifyCss = true excludes = ['*/.less'] includes = ['application.less'] configOptions = [ less: [ compiler: 'less4j' // or standard ] ] }

assets { minifyJs = true minifyCss = true }` with grails 3.3.5

ddelponte commented 6 years ago

@ashubits11 , thank-you for submitting this issue., but I have been unable to reproduce it :(

  1. Do you have the UserPasswordEncoderListener bean defined in grails-app/conf/spring/resources.groovy as described here?
  2. Do you have UserPasswordEncoderListener created in src/main/groovy/your/package/appname/UserPasswordEncoderListener as defined here?
  3. Have you performed a clean followed by run-app or bootRun?
  4. Are you able to attach a sample app which duplicates the issue?
ashubits11 commented 6 years ago

@ddelponte 1> Yes, at same location. 2> Yes, It is there . 3> yes, it works for me . but if run it in intejIdea(IDE i am using) i got same error (some may b there error ).

ddelponte commented 6 years ago

@ashubits11 , it sounds like an issue with how you have the project configured in IntelliJ.

  1. Do any of the suggestions here help? https://blog.softhints.com/intellij-idea-2017-unable-to-resolve-class/
  2. are you able to attach a sample app that duplicates the problem. That would allow me to confirm 100% if the problem is with the app or IntelliJ
  3. Have you tried upgrading to a more recent version of IntelliJ?
ddelponte commented 6 years ago

Closing because it's been >20 days and no feedback has been received.

I'm happy to reopen this if @ashubits11 requests it be reopened.

I'm fairly certain this is not a problem with grails-spring-security-core, but instead a problem with the user's local IntelliJ environment.