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 8362211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:53:24+00:00 2026-06-09T11:53:24+00:00

I have built a streaming relay server using Tomcat. Simple idea is: one client

  • 0

I have built a streaming relay server using Tomcat.

Simple idea is: one client does a POST, another client does a GET. The servlet spawns off a Thread and does a simple byte shuffling until the InputSteam (from the POST) is empty. When done closes / answers both requests. All is fine and it works perfectly, BUT:

Tomcat seems to reuse request objects and even the InputStream objects! Every 10th POST or so, the InputStream can’t be read because already closed. Having a closer look at the logs I realize that the exact same InputStream object was used (and thus closed) by an earlier request. Turns out even the HttpServletRequest object is the exact same.

What is going on here? Why is Tomcat reusing objects which obviously haven’t been reset properly? I’ve tried it with version 7.0.29 and 6.0.16, same thing.

  • 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-09T11:53:26+00:00Added an answer on June 9, 2026 at 11:53 am

    Since this is a resource-management problem (you have a thread holding an InputStream too long), you should be able to fix that: have the servlet that launched the thread (or submitted the task to an Executor… you are using any Executor for this, right?) wait for the thread to finish (or the Future to complete) and release its resources. If you post the code to your byte-pump thread (and relevant parts of the servlet(s)), I can show you how to improve them.

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

Sidebar

Related Questions

I have built a site using php and want to try keep it one
I have built a simple StreamGeometry, using MSDN example: StreamGeometry geometry = new StreamGeometry();
I have simple console application project for live video streaming using cross-platform libs on
How do you define ONE asp.net application? Does it have to be built under
I have built a local DVD Database using Codeigniter, With film names etc in.
I have built a mock object using EasyMock, and I'm trying to have the
I have built ICS source using make -j4, then I have modified the Music
I have built and app which does random stuff and I want to collect
i have built application using codeigniter, my controller name is userReg , in controller
I have built a one page web application that manipulates a set of data:

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.