Grails Spring Security 3 service springSecurityService is null -


springsecurityservice service in user null

i can't seem reference package in following manner

import grails.plugin.springsecurity.*; 

though spring security login page appear, , gradle doesn't complain on missing.

seems no di taking place.

user

package com.sciencecanvas.mykingdom   class user implements serializable {      private static final long serialversionuid = 1      transient springsecurityservice      string username     string password     boolean enabled = true     boolean accountexpired     boolean accountlocked     boolean passwordexpired      user(string username, string password) {         //this()         this.username = username         this.password = password     }      @override     int hashcode() {         username?.hashcode() ?: 0     }      @override     boolean equals(other) {         is(other) || (other instanceof user && other.username == username)     }      @override     string tostring() {         username     }      set<role> getauthorities() {         userrole.findallbyuser(this)*.role     }      def beforeinsert() {         encodepassword()     }      def beforeupdate() {         if (isdirty('password')) {             encodepassword()         }     }      protected void encodepassword() {         password = springsecurityservice?.passwordencoder ? springsecurityservice.encodepassword(password) : password     }      static transients = ['springsecurityservice']      static constraints = {         username blank: false, unique: true         password blank: false     }      static mapping = {         password column: '`password`'     } } 

my build :

buildscript {     ext {         grailsversion = project.grailsversion     }     repositories {         mavenlocal()         maven { url "https://repo.grails.org/grails/core" }     }     dependencies {                 classpath "org.grails:grails-gradle-plugin:$grailsversion"         classpath 'com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0'         classpath "org.grails.plugins:hibernate:4.3.10.5"     } }  plugins {     id "io.spring.dependency-management" version "0.5.2.release"     id 'com.jfrog.bintray' version '1.2' }  version "0.1" group "monopolyserver"  apply plugin: 'maven-publish' apply plugin: "spring-boot" apply plugin: "war" apply plugin: "asset-pipeline" apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: "org.grails.grails-web" apply plugin: "org.grails.grails-gsp"  ext {     grailsversion = project.grailsversion     gradlewrapperversion = project.gradlewrapperversion }  assets {     minifyjs = true     minifycss = true }  repositories {     mavenlocal()     maven { url "https://repo.grails.org/grails/core" } }  dependencymanagement {     imports {         mavenbom "org.grails:grails-bom:$grailsversion"     }     applymavenexclusions false }  dependencies {      //custom plugins     compile 'org.grails.plugins:spring-security-core:3.0.0.m1'      compile "org.springframework.boot:spring-boot-starter-logging"     compile "org.springframework.boot:spring-boot-starter-actuator"     compile "org.springframework.boot:spring-boot-autoconfigure"     compile "org.springframework.boot:spring-boot-starter-tomcat"     compile 'mysql:mysql-connector-java:5.1.36'     compile "org.grails:grails-dependencies"     compile "org.grails:grails-web-boot"      compile "org.grails.plugins:hibernate"     compile "org.grails.plugins:cache"     compile "org.hibernate:hibernate-ehcache"     compile "org.grails.plugins:scaffolding"      //compile ':spring-security-core:2.0-rc5'      runtime "org.grails.plugins:asset-pipeline"      testcompile "org.grails:grails-plugin-testing"     testcompile "org.grails.plugins:geb"      // note: recommended update more robust driver (chrome, firefox etc.)     testruntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'      console "org.grails:grails-console" }  task wrapper(type: wrapper) {     gradleversion = gradlewrapperversion } 

it's because commented out this() in constructor - line of code calls generated default constructor di. described in "what's new" section of docs. either delete constructor , use traditional map constructor, or restore line of code.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -