title: How to solve java.io.StreamCorruptedException: invalid stream header: E6100000?
body: <p>I have a problem with this error java.io.StreamCorruptedException: invalid stream header: E6100000  when i try to log in to app i have this error and i dont know why ?
  I have database in sqlserver connection is good but i cant go to my mian site in app can someone help ?</p>
  <pre><code>2021-02-08 17:04:24.809 ERROR 1936 --- [nio-8080-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.hibernate.type.SerializationException: could not deserialize] with root cause
  
  java.io.StreamCorruptedException: invalid stream header: E6100000
      at java.base/java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:877) ~[na:na]
      at java.base/java.io.ObjectInputStream.&lt;init&gt;(ObjectInputStream.java:350) ~[na:na]
      at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.&lt;init&gt;(SerializationHelper.java:328) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.&lt;init&gt;(SerializationHelper.java:318) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:237) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.internal.util.SerializationHelper.deserialize(SerializationHelper.java:306) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:131) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:117) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:39) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:67) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:65) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:269) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:265) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:238) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:357) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2807) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1545) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1477) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.loader.Loader.getRow(Loader.java:1377) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:644) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.loader.Loader.doQuery(Loader.java:854) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:293) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.loader.Loader.doList(Loader.java:2382) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.loader.Loader.doList(Loader.java:2368) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2198) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.loader.Loader.list(Loader.java:2193) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1248) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at org.hibernate.internal.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:890) ~[hibernate-core-4.1.6.Final.jar:4.1.6.Final]
      at pl.edu.wszib.dao.impl.UserDAOImpl.getUserByLogin(UserDAOImpl.java:50) ~[classes/:na]
      at pl.edu.wszib.service.impl.AuthenticationServiceImpl.authenticationUser(AuthenticationServiceImpl.java:21) ~[classes/:na]
      at pl.edu.wszib.controller.usercontroller.LoginController.authenticateUser(LoginController.java:59) ~[classes/:na]
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
      at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
      at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197) ~[spring-web-5.3.2.jar:5.3.2]
      at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141) ~[spring-web-5.3.2.jar:5.3.2]
      at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) ~[spring-webmvc-5.3.2.jar:5.3.2]
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894) ~[spring-webmvc-5.3.2.jar:5.3.2]
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.2.jar:5.3.2]
      at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.2.jar:5.3.2]
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1061) ~[spring-webmvc-5.3.2.jar:5.3.2]
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:961) ~[spring-webmvc-5.3.2.jar:5.3.2]
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.2.jar:5.3.2]
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.2.jar:5.3.2]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:652) ~[tomcat-embed-core-9.0.41.jar:4.0.FR]
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.2.jar:5.3.2]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[tomcat-embed-core-9.0.41.jar:4.0.FR]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.41.jar:9.0.41]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:105) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:218) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:212) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar:5.3.2]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183) ~[spring-security-web-5.4.2.jar:5.4.2]
      at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) ~[spring-web-5.3.2.jar:5.3.2]
      at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) ~[spring-web-5.3.2.jar:5.3.2]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.2.jar:5.3.2]
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar:5.3.2]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.2.jar:5.3.2]
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar:5.3.2]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.2.jar:5.3.2]
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.2.jar:5.3.2]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:888) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1597) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.41.jar:9.0.41]
      at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
  
  </code></pre>
  <p>my user class</p>
  <pre><code>@Entity
  @Table(schema=&quot;dbo&quot;,name = &quot;UserApp&quot;)
  public class UserApp implements UserDetails  {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int idUser;
  
      private String username;
      private String password;
      private String name;
      private String surname;
      private String email;
      private Point location;
      private String role;
      private String locationName;
  
  </code></pre>
  <p>My authentication</p>
  <pre><code>public class AuthenticationServiceImpl implements IAuthenticationService {
  
      @Autowired
      IUserDAO userDAO;
  
  
      public AuthenticationServiceImpl(IUserDAO userDAO){
          this.userDAO = userDAO;
      }
  
      @Override
      public boolean authenticationUser(UserApp userApp){
          UserApp userAppFromDb = this.userDAO.getUserByLogin(userApp.getUsername());
          return userAppFromDb != null &amp;&amp; userAppFromDb.getPassword().equals(DigestUtils.md5Hex(userApp.getPassword()));
      }
  }
  </code></pre>
  <p>login controller to log in to app</p>
  <pre><code> @RequestMapping(value = &quot;/authenticate&quot;,method = RequestMethod.POST)
      public  String authenticateUser(@ModelAttribute(&quot;userModel&quot;) UserApp userApp, Model model){
          boolean authResult = this.authenticationService.authenticationUser(userApp);
          if(authResult){
              System.out.println(&quot;logged  !!&quot;);
              this.sessionObject.setUserApp(userApp);
              System.out.println(userApp);
              return &quot;rentAppPage&quot;;
          }else{
              model.addAttribute(&quot;errorMessage&quot;,&quot;error data!!!&quot;);
              model.addAttribute(&quot;userModel&quot;,new UserApp());
              return &quot;login&quot;;
          }
      }
  </code></pre>
  <p>Can someone explain why i cant log in to app i have a user in db but i cant and i get this error ?</p>