Skip to content

@EnableJdbcHttpSession not usable in tandem with spring-boot and spring-security #7112

@ssgen

Description

@ssgen

Hello again,

I am not aware how to continue - because Java says it is not Serializable:

org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.Object] to type [byte[]] for value 'org.springframework.security.core.context.SecurityContextImpl@e22bf567: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@e22bf567: Principal: com.temenos.payrep.authmanager.UserDetailsImpl@9dc76c3; Credentials: [PROTECTED]; Authenticated: true; Details: com.temenos.payrep.authmanager.CaptchaAuthenticationDetails@7f8e1da9; Granted Authorities: WRITE_ACCESS, READ_ACCESS'; nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to serialize object using DefaultSerializer; nested exception is java.io.NotSerializableException: org.springframework.dao.support.PersistenceExceptionTranslationInterceptor
	org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:47)
	org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:191)
	org.springframework.session.jdbc.JdbcOperationsSessionRepository.serialize(JdbcOperationsSessionRepository.java:671)

Entry_point_JDBCOperationsSessionRepository
Call_that_breaks_conversion
org spring serializer defaultserializer
NotSerializableException

The interfaces and classes that you have referred are as you point out, but they don't get treated as Serializable (maby something breaks the property along the chain ?):

@Component
public class UserDetailsImpl implements UserDetails {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 4358276832183116476L;

public interface UserDetails extends Serializable {


public class SecurityContextImpl implements SecurityContext {

	private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;

public interface SecurityContext extends Serializable {

public class CaptchaDAOAuthProvider extends DaoAuthenticationProvider implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -734845793362862112L;

Is this framework production grade or just testing out concepts ? (a.k.a.: Can it attain at least WordPress performance at first untouched deployment ?)

Because the other default "Thread Local" SessionRepositoryImpl assigns the last logged in user as the Principal of all sessions ? I wonder how NetFlix copes with that - or is this the reason behind movie piracy - the fact I can automagically become owner of the other sessions.

If you need more details, I should be able to provide limited feedback, mostly related to the framework itself not to the product being developed, according to the agreements in place.

Best regards,
Dan Ștefan Stroe

Originally posted by @ssgen in #7108 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions