Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table per hierarchy on User class causes application not to start #614

Open
4 tasks done
richardvil opened this issue May 8, 2020 · 1 comment
Open
4 tasks done

Comments

@richardvil
Copy link

  • Steps to reproduce provided
  • Stacktrace provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Create a grails app
  2. Install spring security core plugin compile 'org.grails.plugins:spring-security-core:4.0.0'
  3. Add "tablePerHierarchy false" to User class
  4. Extend another class from User

Expected Behaviour

It should create a separate table for the extended class.

Actual Behaviour

Application doesn't start and throws:

Disconnected from the target VM, address: '127.0.0.1:39131', transport: 'socket' 2020-05-08 19:15:10.534 ERROR --- [ restartedMain] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'authenticationProcessingFilterDeregistrationBean': Cannot resolve reference to bean 'authenticationProcessingFilter' while setting bean property 'filter'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationProcessingFilter': Cannot resolve reference to bean 'authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager': Cannot resolve reference to bean 'daoAuthenticationProvider' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoAuthenticationProvider': Cannot resolve reference to bean 'userDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDetailsService': Unsatisfied dependency expressed through method 'setTargetDatastore' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateDatastore': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.orm.hibernate.HibernateDatastore]: Constructor threw exception; nested exception is java.lang.NullPointerException 2020-05-08 19:15:10.584 ERROR --- [ restartedMain] o.s.boot.SpringApplication : Application run failed

Complete stacktrace

The problem occurs only when trying to extend from the User class, it works ok with any other class.

Environment Information

  • Operating System: Linux Manjaro
  • GORM Version: 7.0.4
  • Grails Version: 4.0.3
  • JDK Version: 1.8 openjdk

Example Application

Github repository with example that reproduces the issue:
https://github.com/richardvil/spring-security-core-user-hierarchy-error

@kmpjsharma
Copy link

Same error is happening on Grails 6.1, JDK 11.0.3, Gorm Version: 8.0.0, groovyVersion: 3.0.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants