EOClientApplicationSupport weirdness
EOClientApplicationSupport weirdness
- Subject: EOClientApplicationSupport weirdness
- From: Florijan Stamenkovic <email@hidden>
- Date: Mon, 24 Mar 2008 12:21:14 -0400
Hi all,
I'm trying to implement a JC app connecting to one of multiple
provided URLs. Basically looping through an array of Strings, trying
to connect to each, and if successful, stopping the loop.
The connection is being established through the
com.webobjects.eoapplication.client.EOClientApplicationSupport.main
(...) method, to which the current URL is passed.
I've ended up in a situation where if I have multiple URLs of which
only one is valid, the connection will be established only if the
valid URL is the first to be tried. Otherwise I get an exception
saying that the "WO app is not found on the server". Which is
standard for faulty URLs. Naturally, I've triple checked my loop,
logged the URLs I provide to the EOClientAppSupport.main(...), and it
all checks out in my eyes.
The only explanation I can come up with is that
EOClientApplicationSupport uses some sort of a singleton pattern, and
that the URL for a potential connection is only stored once, the
first time, and reused afterwards regardless of what I pass to the
method. Maybe somebody (Pierre?) can confirm this? And, would this be
considered a bug?
Flor
just in case I am wrong about my loop being OK, the code is below.
// try to connect to all given urls
for(String url : urls){
url = url.trim();
Log.out("Will try to establish a connection to application server at:
" + "\""+url+"\"");
try{
// if connection has been established, return
if(connected) return;
// try to connect
com.webobjects.eoapplication.client.EOClientApplicationSupport.main(
new String[]{"-applicationURL", url});
// wait for the specified timeout
synchronized(monitor){
monitor.wait(TIMEOUT);
}
// if connection has been established, return
if(connected) return;
}catch(Throwable th){}
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden