We are trying to connect to a third party webservice to propagate the changes to the thirdparty system(in the suggeted JNDI look up pattern described in the jboss-webservice tutorial and it is working fine)
Since the number of propagation updates are large,now we wanted to have parallel updates to the third party system,which is like having a master thread creaing few child threads,each will take,say 1000 records and updates in the 3rd party system using the webservices in parallel.
Now,we are having an issue while using multiple threads.If I understand correctly,I guess the issue is because,we are sharing websevice client name registered in the JNDI,and it is giving exceptions.
Has anyone have any idea of how can invoke multi threading with webservices.In the other way,we are trying to have multiple threads connecting the same webservice concurrently in the same appserver.
we are using JBoss 4.0.1 and jdk 1.4
Any suggestions would be appreciated.Following is the code snippet for conencting to webservices:
private boolean connect() throws Exception
Properties env = new Properties();
InitialContext iniCtx = new InitialContext(env);
Service service = (Service)iniCtx.lookup(NN_CLIENT_JNDI_NAME);
nrdInterface = (NRD)service.getPort(NRD.class);
isConnected = true;
logger.fatal("NN Client Wrapper initialization exception. " +
"The JNDI may not be correctly configured as follows: JNDI Location: " + JNDI_URL +
" NN Client JNDI Name: " + NN_CLIENT_JNDI_NAME);
logger.fatal("NN Client Wrapper initialization exception:", exc);
isConnected = false;