Cannot cast object 'User(' with class 'com.test.User' to class 'com.test.User'

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Shashank Agrawal
, 1 year ago
Cannot cast object 'User(' with class 'com.test.User' to class 'com.test.User'
via Stack Overflow by badaboum
, 5 months ago
Object [id=1] was not of the specified subclass [com.vivalio.springmvc.model.User] : Discriminator:
via Stack Overflow by herau
, 2 years ago
An Authentication object was not found in the SecurityContext
via Stack Overflow by We are Borg
, 1 year ago
Provided id of the wrong type for class com.WirTauschen.model.User. Expected: class java.lang.Integer, got class java.lang.String
via Stack Overflow by Supun Wimukthi
, 2 years ago
Could not get JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'supun'@'localhost' (using password: YES)
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'User(' with class 'com.test.User' to class 'com.test.User'
at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnSAM(
at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnNumber(
at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(
at com.test.User.findWhere(User.groovy)
at com.test.User$ Source)
at grails.plugin.springsecurity.userdetails.GormUserDetailsService.$tt__loadUserByUsername(GormUserDetailsService.groovy:60)
at grails.plugin.springsecurity.userdetails.GormUserDetailsService$_loadUserByUsername_closure1.doCall(GormUserDetailsService.groovy)

Users with the same issue

Once, 1 month ago
3 times, 3 months ago
Once, 3 months ago
Once, 7 months ago
Once, 8 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.