• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Problem with glassfish with SOAP requests

 
Greenhorn
Posts: 3
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have a problem with my glassfish instance it's mixing the responses(some times send the response of one client to another).

It's very strange i have 3 applications in the web server one with servlets/jsp, another with JSF and other using JAX-WS.
All the applications only use https with ssl certificate.

Did any one knows sometinh about this?¿?
 
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to Javaranch !!

my glassfish instance it's mixing the responses(some times send the response of one client to another).


could not understand this .. please explain .. probably describe error scenario.
 
Miguel Alduenda
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

This is the error scenario:

I have one web app with servlets and JSP(i use jquery here) and i have the other web app with JAX-WS Web Service, in some cases when clients try to use some Web Service funtcion instead of get an SOAP response they get and Javascript/Jquery code(from the other web app of an different user in the servler/JSP user the app at the sametime) or in more rare cases they get a SOAP response of other user, its like glassfish mixing my clients responses.

I check all my logs and database data and there is no mixed data between useres in there.

Thanks
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Normally each web application has its own context and URL in Servlet container. It is rare to see that app mix up in Servlet container.
How have you deployed these app on Glassfish container? Any specific settings made in Glassfish during development ?
Do these two app share Context URL ? or do they have their unique URL?
For example- when you recieve JQuery response for SOAP request, what Request URL used ? How do you make a SOAP Request (for which you receive back JQuery based response) ?
 
Miguel Alduenda
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the apps doesn't share the context.
The JAX-WS web service it's on:
https://www.facturacfdi.mx/WSTimbrado/WSForcogsaService?wsdl

And the Servlet/JSP it's on:
https://www.facturacfdi.mx/micfdi/

The behavior it's very strange, some responses are mixed but others not, sometimes in the same app and other times in all my apps.
I try to see any pattern but i don't

Thanks
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

when clients try to use some Web Service funtcion instead of get an SOAP response they get and Javascript/Jquery code


Can you post Client code - how client try to make a SOAP Request ?
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for coming back with another query [ I really wanted to know/solve why this error is happening] -

  • Do you use any web server infront of Glassfish server for your applications ?
  • Are you using Load balancing stuff/feature for application deployed in Glassfish ? if yes.. how Load balancer is configured ? using mod_proxy ? mod_JK ? any other way ?
  • Are you using single
  • Loadbalancer for all these 3 Applications ? if yes.. how Load balancer is configured ? using mod_proxy ? mod_JK ? any other way ?


  • Problem may lie in your Web Server than in Glassfish server.

    Please reply
     
    Greenhorn
    Posts: 2
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Abhay Agarwal wrote:Sorry for coming back with another query [ I really wanted to know/solve why this error is happening] -

  • Do you use any web server infront of Glassfish server for your applications ?
  • Are you using Load balancing stuff/feature for application deployed in Glassfish ? if yes.. how Load balancer is configured ? using mod_proxy ? mod_JK ? any other way ?
  • Are you using single
  • Loadbalancer for all these 3 Applications ? if yes.. how Load balancer is configured ? using mod_proxy ? mod_JK ? any other way ?


  • Problem may lie in your Web Server than in Glassfish server.

    Please reply



    I have the same issue with multiple applications (all are web services using JAX-RS) running on 2 identical Glassfish Servers (version 3.1.2.2) behind an HAProxy Load balancer. The One single Load balancer is used for all of the applications on both servers. Sometimes (even very rare), POST messages are mixed between different apps creating garbages. I really need to resolve the issue ASAP.

    Thank you

    Here is the HAProxy config file:

     
    Abhay Agarwal
    Ranch Hand
    Posts: 1376
    Eclipse IDE Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I do not see any cookie settings.

    Try adding cookie settings in HA Proxy configuration

    a. Add cookie SERVERID insert indirect nocache line , just after balance roundrobin line in HAProxy.

    This line tells HAProxy to setup a cookie called SERVERID only if the user did not come with such cookie. It is going to append a “Cache-Control: nocache” as well, since this type of traffic is supposed to be personnal and we don’t want any shared cache on the internet to cache it

    b. Add cookie string in two server lines

    server server1 10.0.0.121:8080 check cookie server1
    server server2 10.0.0.122:8080 check cookie server2

    cookie server1 or cookie server2 provides the value of the cookie inserted by HAProxy. When the client comes back, then HAProxy knows directly which server to choose for this client.

    If you want to use application specific cookie , you can add JSESSIONID. Just replace cookie SERVERID insert indirect nocache with cookie JSESSIONID insert indirect nocache.

    More details around Cookie usage can be found http://blog.exceliance.fr/2012/03/29/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know/

    Try adding this cookie persistence to see whether it solves your issue.



    Thanks
     
    Nam H Nguyen
    Greenhorn
    Posts: 2
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Abhay Agarwal wrote:I do not see any cookie settings.

    Try adding cookie settings in HA Proxy configuration

    a. Add cookie SERVERID insert indirect nocache line , just after balance roundrobin line in HAProxy.

    This line tells HAProxy to setup a cookie called SERVERID only if the user did not come with such cookie. It is going to append a “Cache-Control: nocache” as well, since this type of traffic is supposed to be personnal and we don’t want any shared cache on the internet to cache it

    b. Add cookie string in two server lines

    server server1 10.0.0.121:8080 check cookie server1
    server server2 10.0.0.122:8080 check cookie server2

    cookie server1 or cookie server2 provides the value of the cookie inserted by HAProxy. When the client comes back, then HAProxy knows directly which server to choose for this client.

    If you want to use application specific cookie , you can add JSESSIONID. Just replace cookie SERVERID insert indirect nocache with cookie JSESSIONID insert indirect nocache.

    More details around Cookie usage can be found http://blog.exceliance.fr/2012/03/29/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know/

    Try adding this cookie persistence to see whether it solves your issue.



    Thanks



    Thank you very much, I will try what you recommend and see what happens
     
    reply
      Bookmark Topic Watch Topic
    • New Topic