java.io.StreamCorruptedException: invalid stream header: 30003100

Stack Overflow | Bacem-IJ | 3 years ago
  1. 0

    could not deserialize + invalid stream header: 30003100

    Stack Overflow | 3 years ago | Bacem-IJ
    java.io.StreamCorruptedException: invalid stream header: 30003100
  2. 0

    How to deal with postgresql data types that Hibernate can not deserialize?

    Stack Overflow | 3 years ago | Jeremy
    java.io.StreamCorruptedException: invalid stream header: 30313033
  3. 0

    org.hibernate.type.SerializationException and java.io.StreamCorruptedException: invalid stream header | dwuysan

    wordpress.com | 11 months ago
    java.io.StreamCorruptedException: invalid stream header: 52657175
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    February | 2012 | dwuysan

    wordpress.com | 8 months ago
    java.io.StreamCorruptedException: invalid stream header: 52657175
  6. 0

    after upgrading from annotations 3.3.0GA to 3.3.1GA, my mapped collection (ManyToMany) is broken. i've identified the commit that broke it: http://fisheye.jboss.com/browse/Hibernate/annotations/trunk/src/java/org/hibernate/cfg/annotations/MapBinder.java?r1=12963&r2=14425 The issue is that unless the type is given now expliticly in the @MapKey's @Type, the code now assumes a 'Serializable' type, and attempts to deserialize an object stream from the database column value. the exact exception is: java.io.StreamCorruptedException: invalid stream header at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277) at org.hibernate.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:252) at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:209) at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:240) at org.hibernate.type.SerializableType.fromBytes(SerializableType.java:82) at org.hibernate.type.SerializableType.get(SerializableType.java:39) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163) ... The fix is simple: if @Type is NOT given in the @MapKey annotation, keep the old behavior which at least tries to set the type, even if it may not work in all situations. The attached patch fixes the problem for me. In my particular situation, the map key type is a java.lang.Enum. Here's what my annotated property looks like: @ManyToMany @JoinTable( name="chargeback_owner" ,joinColumns=@JoinColumn(name="person_id",referencedColumnName="person_id") ,inverseJoinColumns=@JoinColumn(name="owner_person_id") ) @MapKey(columns=@Column(name="owner_type_cd"),targetElement=ChargebackOwnerType.class) @Enumerated(EnumType.STRING) @Sort(type=SortType.NATURAL) private SortedMap<ChargebackOwnerType,Person> owners = new TreeMap<ChargebackOwnerType, Person>();

    Hibernate JIRA | 8 years ago | David Mansfield
    java.io.StreamCorruptedException: invalid stream header

  1. tererecool 2 times, last 2 months ago
  2. Stefan Braune 4 times, last 4 months ago
  3. RoiOtero 1 times, last 5 months ago
  4. MoYapro 15 times, last 5 months ago
46 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.StreamCorruptedException

    invalid stream header: 30003100

    at java.io.ObjectInputStream.readStreamHeader()
  2. Java RT
    ObjectInputStream.<init>
    1. java.io.ObjectInputStream.readStreamHeader(Unknown Source)
    2. java.io.ObjectInputStream.<init>(Unknown Source)
    2 frames
  3. Hibernate
    SerializationHelper.deserialize
    1. org.hibernate.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:252)
    2. org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:209)
    3. org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:240)
    3 frames
  4. Hibernate
    CustomLoader.list
    1. org.hibernate.type.SerializableType.fromBytes(SerializableType.java:82)
    2. org.hibernate.type.SerializableType.get(SerializableType.java:39)
    3. org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)
    4. org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154)
    5. org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
    6. org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2101)
    7. org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1380)
    8. org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1308)
    9. org.hibernate.loader.Loader.getRow(Loader.java:1206)
    10. org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:580)
    11. org.hibernate.loader.Loader.doQuery(Loader.java:701)
    12. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
    13. org.hibernate.loader.Loader.doList(Loader.java:2213)
    14. org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
    15. org.hibernate.loader.Loader.list(Loader.java:2099)
    16. org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
    16 frames
  5. Hibernate
    SQLQueryImpl.list
    1. org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
    2. org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
    3. org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
    3 frames
  6. dao.affectation
    AffectationImpl.getAll
    1. dao.affectation.AffectationImpl.getAll(AffectationImpl.java:29)
    1 frame
  7. services.affectation
    AffectationMetierImpl.getAll
    1. services.affectation.AffectationMetierImpl.getAll(AffectationMetierImpl.java:29)
    1 frame
  8. controllers
    NRubriquesPaieController.AffichageRapport
    1. controllers.NRubriquesPaieController.AffichageRapport(NRubriquesPaieController.java:69)
    1 frame
  9. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    4. java.lang.reflect.Method.invoke(Unknown Source)
    4 frames
  10. Spring
    HandlerMethodInvoker.invokeHandlerMethod
    1. org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
    1 frame
  11. Spring MVC
    FrameworkServlet.doPost
    1. org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)
    2. org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)
    3. org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
    4. org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
    5. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
    6. org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
    6 frames
  12. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
    1 frame
  13. Spring MVC
    FrameworkServlet.service
    1. org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
    1 frame
  14. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    1 frame
  15. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    2 frames
  16. Tomcat WS
    WsFilter.doFilter
    1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    1 frame
  17. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    2 frames
  18. Spring Security
    FilterChainProxy$VirtualFilterChain.doFilter
    1. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
    2. org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
    3. org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
    4. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    5. org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
    6. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    7. org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
    8. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    9. org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
    10. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    11. org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
    12. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    13. org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
    14. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    15. org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
    16. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    17. org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
    18. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    19. org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
    20. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    20 frames
  19. org.springframework.security
    WebAsyncManagerIntegrationFilter.doFilterInternal
    1. org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
    1 frame
  20. Spring
    OncePerRequestFilter.doFilter
    1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    1 frame
  21. Spring Security
    FilterChainProxy.doFilter
    1. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    2. org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
    3. org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
    4. org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
    5. org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
    5 frames
  22. Spring
    DelegatingFilterProxy.doFilter
    1. org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
    2. org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
    2 frames
  23. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    8. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    10 frames
  24. Grizzly HTTP
    JIoEndpoint$SocketProcessor.run
    1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
    2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    3. org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
    3 frames
  25. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    3. java.lang.Thread.run(Unknown Source)
    3 frames