• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

400 Bad Request

 
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Bad Request
Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit."
I'm trying to upload my JAVA WEB project but I'm receiving this message above. In pom of my Java WEB I have MySQL, Javascript, JasperSoft, Hibernate and some other things. I'm using Tomcat 9 to define my host server.
host:

connector definition:

I'll appreciate any assistance to solve this problem.
Thanks in advanced.
 
Marshal
Posts: 6208
501
IntelliJ IDE Python TypeScript Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your web server will most likely log that error with more details than is returned to the browser. Check those server logs to see which header field is too large and by how much, check what your web app is sending in that header field, then figure out how to either reduce the size of the field being sent, or increase the accepted size on the server.

Start with the server logs. If you need help deciphering them you can copy and paste it here for us to see.
 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim thanks by return. I've:





I changed my IP by IPaddress.
 
Sheriff
Posts: 17735
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:"Bad Request
Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit."

  <Host name="demonstracao.itcmedbr.com" appBase="demonstracao"
           unpackWARs="true" autoDeploy="true">
==>    <Allias>www.demonstracao.itcmedbr.com</Allias>
       <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
  </Host>


Is that what you actually have or is it just a typo in your post? The element is <Alias>, not <Allias>.

If it's a typo, the next thing to look into is the "Size of a request header field exceeds server limit" and get an idea of what your request looks like.
 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Junilu, yes is wrong I change to <Alias> but problem still the same.
 
Tim Cooke
Marshal
Posts: 6208
501
IntelliJ IDE Python TypeScript Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do your request headers look like?

Did you find any errors on your server relating to responding with 400 Bad Request?
 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I included maxHttpHeaderSize="65536" in connector of my server, same problem.
 
Tim Cooke
Marshal
Posts: 6208
501
IntelliJ IDE Python TypeScript Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That doesn't exactly answer my question. I'm trying to guide you through the journey of evidence gathering which will eventually lead you to understanding the problem. Only when you understand the problem can you work towards a solution.

Let's start with one question at a time:

1. What errors are on your server relating to it responding with 400 Bad Request?
 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I've:
Tomcat server.xml:

 
Bartender
Posts: 15743
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why would there be any error messages in the server.xml file? PLEASE read Tim's instructions and do what he says.
 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand I sended server.xml to show the value set in maxHttpHeaderSize. About log see what I sended above.
 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I Don't know how is request headers look like.
 
Stephan van Hulst
Bartender
Posts: 15743
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, you're somehow sending requests from a client application to your server to test your application, right? How are you sending the requests?

Knowing how to use a network analyzer is a basic skill for a web developer. Please invest some time into learning how to use one. I'm partial to Fiddler for simple tasks.
 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I knew the fiddler don't show nothing.

 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another test:
 
Stephan van Hulst
Bartender
Posts: 15743
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We're not interested in the response from the server. We're interested in the request headers. Fiddler will show those regardless of whether the request succeeded or not.
 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't  know how to get request headers because I am receiving 502 bad gateway.
 
Stephan van Hulst
Bartender
Posts: 15743
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you read my previous post carefully?

Stephan van Hulst wrote:Fiddler will show those regardless of whether the request succeeded or not.

 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Result of Access-Control-Request-Headers Fiddler composer:
Raw field:
 
Stephan van Hulst
Bartender
Posts: 15743
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you even reading what we tell you?
 
Tim Cooke
Marshal
Posts: 6208
501
IntelliJ IDE Python TypeScript Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Cezar, you may do well to take a pause at this moment. As Stephan has also noted, you do not appear to be taking any notice to the advice and guidance you are receiving here and because of that it is no surprise that you are making no progress towards resolving your problem, or even understanding what the problem is.

If you wish to make progress and ultimately solve your problem then please consider taking some time to carefully re-read over this thread and follow the guidance given. There are some open questions that you have not answered that are key to understanding the problem you are facing.

Over to you. We will wait.
 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The fiddler that I downloaded is a free trial in this copy I don't have how to configure other options.
 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Staff note (Ron McLeod) :

[Fiddler] The connection to 'demonstracao.itcmedbr.com' failed.
Error: TimedOut (0x274c).
System.Net.Internals.SocketExceptionFactory+ExtendedSocketException
A connection attempt failed because the connected component did not respond correctly
after a period of time or the established connection failed because the connected host
did not respond. 19x.xxx.xxx.xx:80

 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After increase connectionTimeout and set disableUploadTimeout="true" I am receiving 404 not found in my page.
 
Cezar Apulchro
Ranch Hand
Posts: 722
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fiddler result:
 
Tim Cooke
Marshal
Posts: 6208
501
IntelliJ IDE Python TypeScript Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your unorganised  "poke and hope" approach to problem solving is not serving you well and I believe you are creating more issues on top of your original issue.

I propose you undo all of the things you have done during the course of this conversation and find your way back to the original state with the original error. If you can.

Once you have done that, there are a couple of open questions asked near the start of this thread that would be a productive place to start in finding the answers to.

We can help you find a solution, but only if you work with us.

Let us know how you get on.
 
Saloon Keeper
Posts: 29001
214
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:The fiddler that I downloaded is a free trial in this copy I don't have how to configure other options.



Then you should learn.

You're never going to achieve anything if you just flail around blindly, and eventually no one will want to help you.
 
There were millions of the little blood suckers. But thanks to this tiny ad, I wasn't bitten once.
Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
reply
    Bookmark Topic Watch Topic
  • New Topic