[jboss-user] [EJB 3.0] - Stateless Pooling In JBoss AS.

paata lominadze do-not-reply at jboss.com
Fri Apr 2 06:58:15 EDT 2010

paata lominadze [http://community.jboss.org/people/grdzeli_kaci] created the discussion

"Stateless Pooling In JBoss AS."

To view the discussion, visit: http://community.jboss.org/message/535357#535357

hi all,
I have strange problem.

My Env:
1. OS                         Sun Solaris Sparc
2.Application Server   jboss-4.2.3.GA
3.java                        Oracle JRockit(R) version "1.6.0_05"
4.Ext. Lib.                   Apache http Client ( http://hc.apache.org/httpclient-3.x/ http://hc.apache.org/httpclient-3.x/)

I have one stateless session bean which sends SMS Message to mobile using http client.
my session bean looks like :

public class CommonFasadeBean implements CommonFasade {

    private HttpClient httpClient = null;
    public HttpClient getHttpClient() {
        if (httpClient == null) {

            SimpleHttpConnectionManager manager = new SimpleHttpConnectionManager();

            httpClient = new HttpClient(manager);
        return httpClient;

    public void sendSMS(String fullSms, String phone, String from) {
        HttpClient httpClient = getHttpClient();
        phone = Utils.trimPhone(phone);
        phone = getPhone(phone);
        if (phone == null) {
        String sendToPhone = null;
        switch (phone.length()) {
        case 8:
            sendToPhone = "%s2B995" + phone;
        case 9:
            sendToPhone = "%s2B995" + phone.substring(1);
        String url = "" + from
                + "&username=1&password=1&to=" + sendToPhone + "&text=%s";
        long sc = -999;

        try {

            for (String sms : prepareSmsList(fullSms)) {
                GetMethod method = new GetMethod(String.format(url, "%", sms));
                try {
                    sc = httpClient.executeMethod(method);
                    if (sc == HttpStatus.SC_ACCEPTED) {
                        String response = method.getResponseBodyAsString();

                        if (response.toLowerCase().indexOf("sent") != -1) {
                            logSMS(sms, phone, from);
                } finally {

        } catch (Exception e) {

this code worked for tree years, but problem appeard some days ago.
every second or third day my jboss application server crashes.

when i trying to find promlem i found this :
1. into solaris :
"netstat -an|grep|wc -l  (this is SMS sender HTTP server)"
     and result was : 12678

this is client socket connections from my jboss as, all of them is on a CLOSE_WAIT state.
After this when i looking into the jmx-console i found this :

 http://community.jboss.org/servlet/JiveServlet/showImage/2469/MBeanView.jpeg  http://community.jboss.org/servlet/JiveServlet/downloadImage/2469/450-264/MBeanView.jpeg 

My question is why i have 12826 stateless session bean isntances into as ?
Into my jboss as stateless session pool config max size is 30.

i think that something changed into  HTTP Server or into network.
but i need workarount of this porblem .
is this pattern right for using http clients ? Maybe it will be more correct to use MDB for this ?

when current size of my stateless session bean achieve 40000 the jboss as going down.

can anybody help me what should i do ???

Paata Lominadze.


Reply to this message by going to Community

Start a new discussion in EJB 3.0 at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100402/264906a8/attachment.html 

More information about the jboss-user mailing list