Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8884305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:01:50+00:00 2026-06-14T21:01:50+00:00

I have a vector which is shared between multiple threads and when I try

  • 0

I have a vector which is shared between multiple threads and when I try to read from this vector using one of these threads, I got a StreamCorruptedException.

Here is the stacktrace of the exception:

java.io.StreamCorruptedException: invalid stream header: 7371007E
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:801)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:298)
at prj.ReadThread.run(ReadThread.java:32

The line of code that make this exception in prj.ReadThread.run is

ObjectInputStream o = new ObjectInputStream(RS.getInputStream());

If more information is needed please tell me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:01:52+00:00Added an answer on June 14, 2026 at 9:01 pm

    Wasn’t the stacktrace helpful?

    The exception appears to be thrown in readStreamHeader(), which you can step through in your debugger. I suspect a version number mismatch. Many classes include a Warning: Serialized objects of this class will not be compatible with future Xxx releases.

    Addendum: @S Kh helpfully reports the following:

    The problem was because of streams in Java. I was sending packets from a unique stream on the server (an ObjectOutputStream), but I received data from a different stream each time on the client via new ObjectInputStream for each packet. So that I got this exception.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a vector of pairs representing hops between nodes which I would like
I need a vector container to be shared between two threads of the same
I got this basic doubt. The STL header doesn't have .h extension. #include <vector>
I have a vector of pointers to objects created with new . Multiple threads
I have read that one must not store std::auto_ptr in std::vector and that boost::ptr_vector
Say I have a vector which has thousands of elements. What is the R
I have a vector of strings which are changing its contents for no apparent
So I have a container(any kind, probably std::map or std::vector) which contains objects of
Lets say if I have a vector V, which has 10 elements. If I
Hey, In C++, I have a vector of type: vector<BaseClass*> myVector; In which, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.