On 7/4/2018 2:41 AM, Ritesh Kumar wrote:
I did exactly as you told, created a public static synchronized method. The
problem still exists.

I wasn't addressing the connection problem.  I was addressing the question in the subject -- one client object that you can use everywhere.  But I think the problem you're having now is different than the initial problem, based on the error message:

Maybe returning the client object if it is not null is causing
" java.lang.IllegalStateException: Connection pool shut down" error. It
does run fine for just one time.

This means that you are still calling client.close() after you use the client.  That must be removed.  The entire point of the close() call is to release the internal objects to garbage and make the client unusable.

Thanks,
Shawn

Reply via email to