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

  • SEARCH
  • Home
  • 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 8157461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:17:34+00:00 2026-06-06T17:17:34+00:00

My client is running on a Tomcat server and I do not have access

  • 0

My client is running on a Tomcat server and I do not have access to the client code. So I have to build this server to process requests from the client. For this I am reading on a port as a bytestream as follows:

ServerSocket ss = new ServerSocket(8999);
Socket s = ss.accept();
InputStreamReader in = new InputStreamReader(s.getInputStream());

cbuf = new char[buf_length];
int char_read = in.read(cbuf,0,10000);

inputLine = new String(cbuf);

I am supposed to get SOAP POST requests from the client and these I am able to handle but in between these client requests, I am getting a GET request which looks as follows:

GET / HTTP/1.1
User-Agent: Java/1.6.0_21
Host: localhost:8999
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive

So the user agent is not the client(its probably Tomcat) and it accepts everything. So my server code is unable to handle this. So I tried closing the socket, reopening and trying to read but it reads the same GET request again.

Do I need to send a particular response for this request to continue my program so that the client then is able to send me the next request?

Thanks

  • 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-06T17:17:37+00:00Added an answer on June 6, 2026 at 5:17 pm

    If you really mean that the problem is that you can’t respond with any of the types listed in the Accept header, then the correct HTTP response code is 406. You construct an HTTP response with this status code, send it, and close.

    But, what do you mean you can’t handle it? Because the request says it will accept anything!

    As to what the client will do in response to a 406, well, it’s up to the client. It will retry if it wants to retry, though it shouldn’t in response to a 406 with the same Accept header.

    You’re not even clear on what is making requests to you (it’s not Tomcat) — surely that’s most of your problem here, right? Figure that out. Then you can figure out what you are supposed to be doing.

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

Sidebar

Related Questions

i have a Swing-client and a Server running on tomcat 7, which communicate with
Suppose I have a remote JAX-RS JSON API from a server running Tomcat. I
I have to connect to server(servlet on tomcat) always running and process the http
I have a REST server and a client application running on a mobile device.
I have a somewhat simple Client/Server solution running over C# remoting (System.Runtime.Remoting). The MarshalByRef
I have a new tomcat application server running on tomcat 6, java 6 (openjdk),
I am running a tomcat server and am attempting to update code on that
I have a Java webapp, running in Tomcat 6, that loads RSS feeds from
I'm trying to get a simple socket.io server running: Client: <script src=http://www.my-server.com:8080/socket.io/socket.io.js></script> var socket
My client has PHP running on an IIS server, I know these vti_conf files

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.