One Less Mystery
One Less Mystery
- Subject: One Less Mystery
- From: Mike Schrag <email@hidden>
- Date: Mon, 14 Jul 2008 19:27:04 -0400
One of our guys got tripped up because his hostname was floating
between what we expected it to be and his IP address. After some
digging, I've resolved a mystery (well, it was a mystery to me ..
maybe other people knew about it :) ).
If your CGI adaptor URL is http://127.0.0.1/cgi-bin/WebObjects, at
runtime, WOApplication converts that to http://
<application.hostAddress()>/cgi-bin/WebObjects.
If you CGI adaptor URL is http://localhost/cgi-bin/WebObjects, at
runtime, WOApplication converts that to http://<application.host()>/
cgi-bin/WebObjects.
application.host() considers your -WOHost setting, hostAddress uses
InetAddress.getByName(host()). So if you've ever been confused and
perplexed as to why your app keeps using your IP address even when you
set WOHost, this is why. This is especially a problem when you're
testing with cookies on your local machine, which is really sensitive
to host name changing.
Part of the confusing part here is that WOLips defaults to 127.0.0.1.
I think this is wrong and I'm about to change it (unless someone has a
good reason behind it). In the meantime, you can to several things:
1) Change the WOAdaptorURL in your launch config (to change this on a
per-app basis)
2) Change the WOAdaptorURL in Preferences=>WOLips=>Launch. This will
change the defaults globally. I don't recall if this cascades to
existing run configs or not.
So to be safe and make sure your app works in dev like it does in
deployment (which would have a consistent hostname), set WOAdaptorURL
to http://localhost/cgi-bin/WebObjects and add a -WOHost
yourhost.local (or whatever your fixed hostname is).
ms
_______________________________________________
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