aspose file tools*
The moose likes Web Services and the fly likes Problem with glassfish with SOAP requests Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem with glassfish with SOAP requests" Watch "Problem with glassfish with SOAP requests" New topic
Author

Problem with glassfish with SOAP requests

Miguel Alduenda
Greenhorn

Joined: Jan 28, 2014
Posts: 3
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?¿?
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1162
    
    1

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.

Oracle Java Web Service Developer (1z0-897), Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I
Miguel Alduenda
Greenhorn

Joined: Jan 28, 2014
Posts: 3
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

Joined: Feb 29, 2008
Posts: 1162
    
    1

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

Joined: Jan 28, 2014
Posts: 3
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

Joined: Feb 29, 2008
Posts: 1162
    
    1

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

Joined: Feb 29, 2008
Posts: 1162
    
    1

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
    Nam H Nguyen
    Greenhorn

    Joined: Feb 15, 2014
    Posts: 2
    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

    Joined: Feb 29, 2008
    Posts: 1162
        
        1

    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

    Joined: Feb 15, 2014
    Posts: 2
    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
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Problem with glassfish with SOAP requests