Re: EOClientApplicationSupport weirdness
Re: EOClientApplicationSupport weirdness
- Subject: Re: EOClientApplicationSupport weirdness
- From: John Pollard <email@hidden>
- Date: Tue, 25 Mar 2008 21:42:20 +0000
Hi Florijan,
All I can say is that this affects our JC application too. We allow
the connection URL to be set in a login window, but any changes after
the first connection attempt are ignored; the original URL seems to
stick as you say. This problem has been annoying for a long time but I
always put it down to the fact that this
com
.webobjects.eoapplication.client.EOClientApplicationSupport.main(...)
method was obviously not meant to be used in the way us non-nibber JC
people use it to establish the client/server connection. I think its
time we were given an initialisation method to call instead of
hijacking this main() method.
John
On 24 Mar 2008, at 16:21, Florijan Stamenkovic wrote:
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
_______________________________________________
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