You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to log in to a JHipster-generated application using Redis for caching, I encounter a "Failed to sign in! Please check your credentials and try again. with error.http.500" error. This issue arises despite not making any changes to the default JHipster configuration. The backend logs indicate a LazyInitializationException related to Hibernate and Redis.
Click to expand the error log
2023-12-12T15:09:20.060-05:00 INFO 31453 --- [ restartedMain] com.mycompany.myapp.RedisTApp :
2023-12-12T15:10:11.485-05:00 WARN 31453 --- [ XNIO-1 task-2] o.s.w.s.h.HandlerMappingIntrospector : Cache miss for REQUEST dispatch to '/api/authenticate' (previous null). Performing MatchableHandlerMapping lookup. This is logged once only at WARN level, and every time at TRACE.
2023-12-12T15:10:11.540-05:00 DEBUG 31453 --- [ XNIO-1 task-2] c.m.m.web.rest.AuthenticateController : Enter: authorize() with argument[s] = [LoginVM{username='admin', rememberMe=false}]
2023-12-12T15:10:11.611-05:00 DEBUG 31453 --- [ XNIO-1 task-2] c.m.m.security.DomainUserDetailsService : Authenticating admin
2023-12-12T15:10:11.635-05:00 ERROR 31453 --- [sson-netty-2-29] o.r.client.handler.CommandDecoder : Unable to decode data. channel: [id: 0xb455e2e0, L:/127.0.0.1:54822 - R:localhost/127.0.0.1:6379], reply: ReplayingDecoderByteBuf(ridx=274, widx=274), command: (EVAL), promise: java.util.concurrent.CompletableFuture@422de334[Not completed, 1 dependents], params: [local value = redis.call('hget', KEYS[1], ARGV[3]); if value == false then return nil; end; local expireDateScore = redis.call('zscore', KEYS[2], ARGV[3]); if expireDateScore ~= false and tonumber(expireDateScore) <= tonumber(ARGV[2]) then return nil; end; return value; , 3, usersByLogin, jcache_timeout_set:{usersByLogin}, jcache_removed_channel:{usersByLogin}, -1, 1702411811613, PooledUnsafeDirectByteBuf(ridx: 0, widx: 6, cap: 256)]
com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:146)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:129)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:880)
at org.redisson.codec.Kryo5Codec$4.decode(Kryo5Codec.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:426)
at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:216)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:120)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
at org.hibernate.collection.spi.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:634)
at org.hibernate.collection.spi.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:217)
at org.hibernate.collection.spi.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:613)
at org.hibernate.collection.spi.PersistentSet.add(PersistentSet.java:189)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:241)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:44)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:799)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:124)
... 26 common frames omitted
2023-12-12T15:10:11.638-05:00 ERROR 31453 --- [sson-netty-2-29] o.r.client.handler.ErrorsLoggingHandler : Exception occured. Channel: [id: 0xb455e2e0, L:/127.0.0.1:54822 - R:localhost/127.0.0.1:6379]
io.netty.handler.codec.DecoderException: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:146)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:129)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:880)
at org.redisson.codec.Kryo5Codec$4.decode(Kryo5Codec.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:426)
at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:216)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:120)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
... 17 common frames omitted
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
at org.hibernate.collection.spi.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:634)
at org.hibernate.collection.spi.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:217)
at org.hibernate.collection.spi.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:613)
at org.hibernate.collection.spi.PersistentSet.add(PersistentSet.java:189)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:241)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:44)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:799)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:124)
... 26 common frames omitted
2023-12-12T15:10:11.642-05:00 ERROR 31453 --- [ XNIO-1 task-2] c.m.m.web.rest.AuthenticateController : Exception in authorize() with cause = 'javax.cache.CacheException: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session_Serialization trace:_authorities (com.mycompany.myapp.domain.User)' and exception = 'com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session_Serialization trace:_authorities (com.mycompany.myapp.domain.User)'
org.springframework.security.authentication.InternalAuthenticationServiceException: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:118)
at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:133)
at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:182)
at com.mycompany.myapp.web.rest.AuthenticateController.authorize(AuthenticateController.java:61)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:352)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:64)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
at com.mycompany.myapp.aop.logging.LoggingAspect.logAround(LoggingAspect.java:105)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:637)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:627)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:71)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:717)
at com.mycompany.myapp.web.rest.AuthenticateController$$SpringCGLIB$$0.authorize(<generated>)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:254)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:182)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:917)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:829)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:547)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:110)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.security.web.FilterChainProxy.lambda$doFilterInternal$3(FilterChainProxy.java:231)
at org.springframework.security.web.ObservationFilterChainDecorator$FilterObservation$SimpleFilterObservation.lambda$wrap$1(ObservationFilterChainDecorator.java:479)
at org.springframework.security.web.ObservationFilterChainDecorator$AroundFilterObservation$SimpleAroundFilterObservation.lambda$wrap$1(ObservationFilterChainDecorator.java:340)
at org.springframework.security.web.ObservationFilterChainDecorator.lambda$wrapSecured$0(ObservationFilterChainDecorator.java:82)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:128)
at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:100)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:131)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:85)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:179)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at com.mycompany.myapp.web.filter.SpaWebFilter.doFilterInternal(SpaWebFilter.java:31)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.security.oauth2.server.resource.web.authentication.BearerTokenAuthenticationFilter.doFilterInternal(BearerTokenAuthenticationFilter.java:145)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:93)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:82)
at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:69)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:62)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:227)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.wrapFilter(ObservationFilterChainDecorator.java:240)
at org.springframework.security.web.ObservationFilterChainDecorator$AroundFilterObservation$SimpleAroundFilterObservation.lambda$wrap$0(ObservationFilterChainDecorator.java:323)
at org.springframework.security.web.ObservationFilterChainDecorator$ObservationFilter.doFilter(ObservationFilterChainDecorator.java:224)
at org.springframework.security.web.ObservationFilterChainDecorator$VirtualFilterChain.doFilter(ObservationFilterChainDecorator.java:137)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:233)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:191)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:352)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:268)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.web.filter.ServerHttpObservationFilter.doFilterInternal(ServerHttpObservationFilter.java:109)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:276)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:132)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:256)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:101)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1512)
at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: javax.cache.CacheException: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at org.redisson.jcache.JCache.lambda$getAsync$2(JCache.java:258)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
at org.redisson.command.RedisExecutor.handleError(RedisExecutor.java:602)
at org.redisson.command.RedisExecutor.handleResult(RedisExecutor.java:584)
at org.redisson.command.RedisExecutor.checkAttemptPromise(RedisExecutor.java:572)
at org.redisson.command.RedisExecutor.lambda$execute$5(RedisExecutor.java:202)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
at org.redisson.client.protocol.CommandData.tryFailure(CommandData.java:87)
at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:222)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:120)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
... 1 common frames omitted
Caused by: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:146)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:129)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:880)
at org.redisson.codec.Kryo5Codec$4.decode(Kryo5Codec.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:426)
at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:216)
... 21 common frames omitted
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
at org.hibernate.collection.spi.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:634)
at org.hibernate.collection.spi.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:217)
at org.hibernate.collection.spi.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:613)
at org.hibernate.collection.spi.PersistentSet.add(PersistentSet.java:189)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:241)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:44)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:799)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:124)
... 26 common frames omitted
2023-12-12T15:10:11.662-05:00 WARN 31453 --- [ XNIO-1 task-2] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.springframework.security.authentication.InternalAuthenticationServiceException: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session<EOL>Serialization trace:<EOL>authorities (com.mycompany.myapp.domain.User)]
2023-12-12T15:10:11.674-05:00 DEBUG 31453 --- [ XNIO-1 task-2] c.m.myapp.web.rest.AccountResource : Enter: getAccount() with argument[s] = []
2023-12-12T15:10:11.676-05:00 DEBUG 31453 --- [ XNIO-1 task-2] c.mycompany.myapp.service.UserService : Enter: getUserWithAuthorities() with argument[s] = []
2023-12-12T15:10:11.678-05:00 ERROR 31453 --- [sson-netty-2-31] o.r.client.handler.CommandDecoder : Unable to decode data. channel: [id: 0x9ba6d837, L:/127.0.0.1:54823 - R:localhost/127.0.0.1:6379], reply: ReplayingDecoderByteBuf(ridx=274, widx=274), command: (EVAL), promise: java.util.concurrent.CompletableFuture@320c75e4[Not completed, 1 dependents], params: [local value = redis.call('hget', KEYS[1], ARGV[3]); if value == false then return nil; end; local expireDateScore = redis.call('zscore', KEYS[2], ARGV[3]); if expireDateScore ~= false and tonumber(expireDateScore) <= tonumber(ARGV[2]) then return nil; end; return value; , 3, usersByLogin, jcache_timeout_set:{usersByLogin}, jcache_removed_channel:{usersByLogin}, -1, 1702411811676, PooledUnsafeDirectByteBuf(ridx: 0, widx: 6, cap: 256)]
com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:146)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:129)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:880)
at org.redisson.codec.Kryo5Codec$4.decode(Kryo5Codec.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:426)
at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:216)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:120)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
at org.hibernate.collection.spi.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:634)
at org.hibernate.collection.spi.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:217)
at org.hibernate.collection.spi.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:613)
at org.hibernate.collection.spi.PersistentSet.add(PersistentSet.java:189)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:241)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:44)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:799)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:124)
... 26 common frames omitted
2023-12-12T15:10:11.678-05:00 ERROR 31453 --- [sson-netty-2-31] o.r.client.handler.ErrorsLoggingHandler : Exception occured. Channel: [id: 0x9ba6d837, L:/127.0.0.1:54823 - R:localhost/127.0.0.1:6379]
io.netty.handler.codec.DecoderException: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:146)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:129)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:880)
at org.redisson.codec.Kryo5Codec$4.decode(Kryo5Codec.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:426)
at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:216)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:120)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
... 17 common frames omitted
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
at org.hibernate.collection.spi.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:634)
at org.hibernate.collection.spi.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:217)
at org.hibernate.collection.spi.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:613)
at org.hibernate.collection.spi.PersistentSet.add(PersistentSet.java:189)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:241)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:44)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:799)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:124)
... 26 common frames omitted
2023-12-12T15:10:11.678-05:00 ERROR 31453 --- [ XNIO-1 task-2] c.mycompany.myapp.service.UserService : Exception in getUserWithAuthorities() with cause = 'com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session_Serialization trace:_authorities (com.mycompany.myapp.domain.User)' and exception = 'com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session_Serialization trace:_authorities (com.mycompany.myapp.domain.User)'
javax.cache.CacheException: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at org.redisson.jcache.JCache.lambda$getAsync$2(JCache.java:258)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
at org.redisson.command.RedisExecutor.handleError(RedisExecutor.java:602)
at org.redisson.command.RedisExecutor.handleResult(RedisExecutor.java:584)
at org.redisson.command.RedisExecutor.checkAttemptPromise(RedisExecutor.java:572)
at org.redisson.command.RedisExecutor.lambda$execute$5(RedisExecutor.java:202)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
at org.redisson.client.protocol.CommandData.tryFailure(CommandData.java:87)
at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:222)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:120)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:146)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:129)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:880)
at org.redisson.codec.Kryo5Codec$4.decode(Kryo5Codec.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:426)
at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:216)
... 21 common frames omitted
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
at org.hibernate.collection.spi.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:634)
at org.hibernate.collection.spi.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:217)
at org.hibernate.collection.spi.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:613)
at org.hibernate.collection.spi.PersistentSet.add(PersistentSet.java:189)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:241)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:44)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:799)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:124)
... 26 common frames omitted
2023-12-12T15:10:11.681-05:00 ERROR 31453 --- [ XNIO-1 task-2] c.m.myapp.web.rest.AccountResource : Exception in getAccount() with cause = 'com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session_Serialization trace:_authorities (com.mycompany.myapp.domain.User)' and exception = 'com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session_Serialization trace:_authorities (com.mycompany.myapp.domain.User)'
javax.cache.CacheException: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at org.redisson.jcache.JCache.lambda$getAsync$2(JCache.java:258)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
at org.redisson.command.RedisExecutor.handleError(RedisExecutor.java:602)
at org.redisson.command.RedisExecutor.handleResult(RedisExecutor.java:584)
at org.redisson.command.RedisExecutor.checkAttemptPromise(RedisExecutor.java:572)
at org.redisson.command.RedisExecutor.lambda$execute$5(RedisExecutor.java:202)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
at org.redisson.client.protocol.CommandData.tryFailure(CommandData.java:87)
at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:222)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:120)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
Serialization trace:
authorities (com.mycompany.myapp.domain.User)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:146)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:129)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:880)
at org.redisson.codec.Kryo5Codec$4.decode(Kryo5Codec.java:144)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:426)
at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:216)
... 21 common frames omitted
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session
at org.hibernate.collection.spi.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:634)
at org.hibernate.collection.spi.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:217)
at org.hibernate.collection.spi.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:613)
at org.hibernate.collection.spi.PersistentSet.add(PersistentSet.java:189)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:241)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:44)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:799)
at com.esotericsoftware.kryo.serializers.ReflectField.read(ReflectField.java:124)
... 26 common frames omitted
2023-12-12T15:10:11.682-05:00 WARN 31453 --- [ XNIO-1 task-2] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [javax.cache.CacheException: com.esotericsoftware.kryo.KryoException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection: could not initialize proxy - no Session<EOL>Serialization trace:<EOL>authorities (com.mycompany.myapp.domain.User)]
Motivation for or Use Case
The inability to log in is critical as it prevents any form of user authentication or application usage in its intended form.
Reproduce the error
Generate a JHipster application with default settings.
Start the required services using Docker: docker compose -f src/main/docker/mysql.yml up -d and docker compose -f src/main/docker/redis.yml up -d.
Start the application: ./mvnw and npm start.
Attempt to log in using the default admin and user credentials.
Related issues
N/A
Suggest a Fix
The error seems related to Hibernate's lazy initialization in conjunction with Redis caching. A potential area of investigation might be the handling of Hibernate entities within the Redis cache.
JHipster Version(s)
v8.1.0
JHipster configuration
WARNING! Since JHipster v8, the jhipster command will not use the locally installed generator-jhipster.
If you want to execute the locally installed generator-jhipster, run: npx jhipster
Overview of the issue
When attempting to log in to a JHipster-generated application using Redis for caching, I encounter a "Failed to sign in! Please check your credentials and try again. with error.http.500" error. This issue arises despite not making any changes to the default JHipster configuration. The backend logs indicate a LazyInitializationException related to Hibernate and Redis.
Click to expand the error log
2023-12-12T15:09:20.060-05:00 INFO 31453 --- [ restartedMain] com.mycompany.myapp.RedisTApp :
Motivation for or Use Case
The inability to log in is critical as it prevents any form of user authentication or application usage in its intended form.
Reproduce the error
Attempt to log in using the default admin and user credentials.
Related issues
N/A
Suggest a Fix
The error seems related to Hibernate's lazy initialization in conjunction with Redis caching. A potential area of investigation might be the handling of Hibernate entities within the Redis cache.
JHipster Version(s)
v8.1.0
JHipster configuration
WARNING! Since JHipster v8, the jhipster command will not use the locally installed generator-jhipster.
If you want to execute the locally installed generator-jhipster, run: npx jhipster
██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║
╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗
╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝
https://www.jhipster.tech
Welcome to JHipster v8.1.0
Welcome to the JHipster Information Sub-Generator
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
Environment and Tools
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode)
git version 2.43.0
node: v18.19.0
npm: 10.2.3
Docker version 24.0.7, build afdd53b
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Congratulations, JHipster execution is complete!
If you find JHipster useful consider sponsoring the project https://www.jhipster.tech/sponsors/
Thanks for using JHipster!
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryN/A
Browsers and Operating System
Browser: Chrome Version 119.0.6045.199 (Official Build) (arm64)
Operating System: macOS, version Sonoma 14.1.2 on an M3 chip
The text was updated successfully, but these errors were encountered: