This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
No announcement yet.
null pointer exception for loadUserByUserNamePage Title Module
I got a loadUserByUsername which calls a method from a DAO to get a User (which implements UserDetails) from the database. When calling loadUserByUsername all data is correct (such as user.getAuthorities and so on) but when logging in with the default spring security login I receive a NullPointer exception.
To bad someone finds out how to solve his problem and does not write the solution in the according thread.
The problem is described above - failure to inject a resource. Since you are apparently able to load user data, the only thing your problem has in common is a NPE. Without the stacktrace (and preferably the debug log) it's unlikely anyone will be able to help you fix things. Please attach those and someone might be able to suggest a solution.
Thank you for your reply.
I did not want to 'highjack' this thread thus I haven't attached any additional files. In fact I wasn't even sure if I had the same problem but was a bit frustrated that I couldn't see the solution straight ahead, sorry!
For my problem: I was using the spring-security-core library 2.0.1 so no EntityManager was created (see http://jira.springframework.org/browse/SEC-750).. with the current snapshot of the library the problem does not exist anymore.
Last edited by mgood; May 18th, 2008, 09:02 AM.
Reason: Added link to Bug SEC-750