You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by gmeroz <gi...@b-events.com> on 2006/05/14 10:45:13 UTC

Multi-threaded java client

i have a multi-thread enviornment in which i need to connect different
servers - some of them use SSL. 
When i set the following System property "javax.net.ssl.trustStore" for one
thread, it may cause another thread to use the wrong trustStore on its call
(the different threads uses different certificates).

Is there a way to have clients to different SSL servers on the same JVM? or
an alternative to the "javax.net.ssl.trustStore" to be setted on the Axis
call?

The same problem exist on regular J2ee server if it is used as a client to
other server....
--
View this message in context: http://www.nabble.com/Multi-threaded-java-client-t1615595.html#a4378849
Sent from the Axis - User forum at Nabble.com.


Re: Multi-threaded java client

Posted by Xinjun Chen <xj...@gmail.com>.
1. Normally threads running on a machine with a single IP should use the
same truststore. You can import a trusted CA into a single truststore.
2. If you have no choice but to use different truststores for different
threads, you need to customized your SSLSocketFactory instead of using the
default SSLSocketFactory. Different thread use different custom
SSLSocketFactory. The following link tells you how to write your custom
SSLSocketFactory. Basicely you need to overwrite the TrustManagerFactory, so
that different thread use different TrustManagerFactory which load different
truststores.

http://www-128.ibm.com/developerworks/java/library/j-customssl/

By the way, axis maillist is not for such kind of question and you will not
get expected response regarding irrelevant questions. :-)

Regards,
Xinjun

On 5/14/06, gmeroz <gi...@b-events.com> wrote:
>
>
> i have a multi-thread enviornment in which i need to connect different
> servers - some of them use SSL.
> When i set the following System property "javax.net.ssl.trustStore" for
> one
> thread, it may cause another thread to use the wrong trustStore on its
> call
> (the different threads uses different certificates).
>
> Is there a way to have clients to different SSL servers on the same JVM?
> or
> an alternative to the "javax.net.ssl.trustStore" to be setted on the Axis
> call?
>
> The same problem exist on regular J2ee server if it is used as a client to
> other server....
> --
> View this message in context:
> http://www.nabble.com/Multi-threaded-java-client-t1615595.html#a4378849
> Sent from the Axis - User forum at Nabble.com.
>
>

[Axis2] Multiple service instances

Posted by Roman Weidlich <ro...@gmx.at>.
MyService (application scope) starts in its constructor a thread:


private static boolean first = true;

   public MyService() {
     if (first) {
       Thread t = new Thread(this);
       t.start();
       first = false;
     }
   }



On redeploy (drop a new MyService.aar into axis2 services dir) and on 
the next invocation the thread starts again!

It seems tomcat don't kill the thread started by MyService during 
redeploy...