Hello,
I apologize, I completely missed your post. I think it belongs more to the
Troubleshooting forum.
Apparently the problem is that your client was not able to connect to the server, or not quickly enough.
In version 1.4 some behavior has changed, although the client API has not.
To accommodate the new local execution feature, the client no longer indefinitely waits until a connection is established before returning from its initialization.
In some cases, it is possible that no connection to the server is active at the time you submit your first job, which would cause the exception that you observe.
I see to main approaches to overcome this:
1) you can specify the time the client initialization will will wait for an active connection, by setting the property "jppf.client.max.init.time" to a higher value. The default value is 1000 (milliseconds).
2) You can do your job submission within a loop that looks out for the JPPFException, as in this example:
// retry up to 10 times
int retries = 10;
boolean end = false;
while (!end)
{
try
{
results = jppfClient.submit(myListOfTasks, myDataProvider);
// submission successfull, end of the loop
end = true;
}
catch (JPPFException e)
{
// if tried less than 10 times
if (retries > 1)
{
// wait 1/10th of a second
Thread.sleep(100);
retries--;
}
// otherwise throw the exception
else throw e;
}
}
The other possibility is that the client can't connect to the server, probably due to improper settings in the client configuration file.
To check this, can you please verify that you have something similar to thse lines printed in the client console:
[client: driver1] ClassServerDelegate.init(): Attempting connection to the class server
[client: driver1] ClassServerDelegate.init(): Reconnected to the class server
[client: driver1] JPPFClient.init(): Attempting connection to the JPPF driver
[client: driver1] JPPFClient.init(): Reconnected to the JPPF driver
I hope this helps,
-Laurent