Skip to content
Menu
Kenan Erarslan
  • Hasscript
    • BİNlerce cevap
    • Hello world!
    • Hasscript motivasyonumuz
    • 60 soruyu geçtik
    • 50 Üye / 90 soru / 100 cevap.
    • 200 soru
    • 365 gün geride kaldı.
    • 2019’un Hasscript’i
  • Experience
    • How to select Right Programming Language For Next Project
    • BigData Study
      • Hadoop Learning Journey / 1 / What is Hadoop
      • Hadoop Study Part 2 – Meaningless Fight
      • Hadoop Learning Journey / 3 / Reinventing The Wheel
  • Türkçe
    • Apache Ant
      • Apache Ant – 1) Kurulum
      • Apache Ant – 2) Dosyaları derlemek
      • Apache Ant – 3) Özellik işleri (property tasks)
      • Apache Ant – 4) Özellik dosyaları
      • Apache Ant – 5) Veri tipleri
      • Apache Ant – 6) Proje derlemek
      • Apache Ant – 7) Döküman derlemek
      • Apache Ant – 8) Jar oluşturmak
    • Duygu / Düşünce
      • Ben bu işin neresindeyim?
      • Enkazlar ülkesi
      • Hayal kurmak güzeldir.
      • Arch Linux ile tanışmak ve zorluklar
Kenan Erarslan

Struggling Experiences: Client – Server Communication

Posted on January 25, 2021January 27, 2021

In the past I had lots of problems while developing software applications and I am still having them. Here I would like to share one of my experience about client-server communication problem which caused me a lot of trouble until I sorted it out.

It was back in 2011. We were developing an application for a customer. We had released our application and about 150 users started to using it all day long. Our application was working on an Apache Tomcat server. The team reported one bug about uploading file which was working unstable. The problem was that, time to time, users were getting a message like “error” with no explanation while uploading a file just after clicking the upload button. However, it was the kind of an error which we were unsuccessful to generate using a pattern. We definitely had no clue about the reason.

Identifying the problem

As the first step, I tried to generate the error intentionally but I failed. When I changed users to test, the users that were getting error were not getting it anymore while those that didn’t get the error started getting the error. I thought it was about a user related data, kept changing users and clients (computer), but it still had the same problem. I tried to take note about computers and time as far as I could recall. In the end there was no evidence as to why the problem occurred.

We tried to debug the application, but that was not effective because the pages had been developed using JSP techonolgy. We might have tried couple of things but did not lead us to conclusion.

Then I thought it is related with oracle rowid (another struggling experience, the same problem with oracle rowid) and tried to prove it and it resulted as false alarm. After several days and hours I quit searching the problem and only tried to find a workaround solution.

The customer learned how to live with that error.

3 months later, a friend started working with us. He had no experience on developing java applications and I was his mentor. I was advising him to develop some small applications using java related technologies like JSP, Servlet, jdbc etc

The problem

One day he asked me about servlets and I said it was better to develop some small POC application so that we could observe results and this would be kind of hands-on training. With the help of universe we selected a JSP script to develop it using servlets which was the page used for upload functionality. While we were playing with the code, we started debugging it. Suddenly, I had realised that session id caused a problem. The session id was meant to be a number but it was not. It had an additional plus (+) character.

Our upload component retrieves session id and sends the data chunks along with it. Our client code fetches session id from the server within the response body and sends it as a query string. If you send a plus character as a query string, you need to make it encoded to avoid undesired results like we had. Your browser will send it as a plus character (+) but when your server gets this query string, it will process it as a space character and will map it with no active session. Then the server will respond with ERROR.

Conclusion

Someone in the company had developed this page years ago and we had the problem with a certain version of tomcat. We developed an interceptor for all http messages and encoded them before sending to the server side and develop another piece of code which confronts the incoming messages and decodes them into normal form. In the end, our problem was solved.

1 thought on “Struggling Experiences: Client – Server Communication”

  1. Eduardo says:
    January 26, 2021 at 9:09 pm

    Remembering all the minor details of a 10-year old problem! Well done. Not only for the details but your dedication of solving it

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

2 × five =

March 2021
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  
« Feb    

RSS Hasscript.com | Programlama hakkında – Yeni soru ve cevaplar

  • npm proxy ayarlarını temizlemek nasıl yapılır?
  • Spring Security üzerinde bazı methodlara token olmadan nasıl erişebilirim?
  • Cevaplandı: Bir değerim var, sınıf tanımlamak istemiyorum. Nasıl tanımlayabilirim?
  • Spring security şifresiz login nasıl olabilirim?
  • Spring boot projesinde methodları rol bazlı nasıl ayırabilirim?
  • Cevaplandı: "No converter found capable of converting from type" hatası alıyorum, neden?
  • Cevaplandı: Spring data jpa için limit nasıl tanımlarım?
  • Cevaplandı: Java'da para değerlerini ne tarz değişkende tutmak mantıklıdır?
  • "There is no PasswordEncoder mapped for the id " hatası nasıl çözülür?
  • Cevaplandı: vuetify ile validasyonda 0 sorunu
©2021 Kenan Erarslan | WordPress Theme by Superbthemes.com