10.28.2007

glassfish ajp proxy

another post from the old blog that i didn't want to lose:

Jean-Francois Arcand wrote an excellent blog entry on getting an ajp proxy running with glassfish. the only problem was that it used mod_jk. now, that's great for httpd pre-2.2, but as of version 2.2 there is a much better way. mod_proxy_ajp allows you to proxy with ajp the same way you would with any other protocol. consequently, all of the worker.properties stuff can be replaced by apache configuration directives like:

<IfModule proxy_module>
<IfModule proxy_ajp_module>
  <Location /pebble>
    ProxyPass ajp://127.0.0.1:8009/pebble
  </Location>
</IfModule>
</IfModule>

comments

martyn
Hi
While configuring with the proxy_ajp this seems to forward all request to glassfish is there a way to configure it so it works like the mod_jk that you can specify file extentions that should be forwarded and let apache handle the html,jpegs,gif of the sort .
I have been going through the documentation but don't see any thing that does this. I would be greatfull for any pointers on this.
regards martyn.
me
hey, sorry for the very, very slow reply. you're right in that the example i gave forwards everything. and while i'm not expert on apache or proxies, i can say that mod_proxy is pretty versatile. i'm pretty sure that you could accomplish what you're trying to do with the ProxyMatch directive. another way to go might be to take a look at mod_cache. it would probably boost the performance of your static content in a more dynamic way. hope that helps.
anonymous
I think you also need a ProxyPassReverse, in case the glassfish side sends an HTTP redirect.

I'm not totally sure, but that is what I have read.  :-)

java with leopard

there seem to be a fair number of java developers using os x these days, so i thought that i'd quickly write down some thoughts about java on the new os.

java 1.6

the obvious question is: does leopard comes with java 1.6? at the moment, java -version gives me

java version "1.5.0_13" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237) Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)

and ls /System/Library/Frameworks/JavaVM.framework/Versions/ gives me

1.3        1.4        1.4.2      1.5.0      Current 1.3.1      1.4.1      1.5        A          CurrentJDK

so, the obvious answer is no. honestly, this is a bit annoying. we know that there were some issues getting leopard out in time, but things seem to be dropping all over the place. it actually reminds me of vista a little bit... how sad. anyway, i still maintain hope that the missing pieces will show up in a software update pretty soon. otherwise...

so what's the upside? what's the reason that i'm not feeling dirty all over for owning a bit of AAPL (aside from the positive slope in that graph)?

spaces

while i spend my time at home with my macbook attached to a 20" cinema display, the rest of the time i'm confined to a mere 13". at any given time i'll have at least a browser, an ide, a text editor, a command prompt on my tiny little display and it gets a bit cluttered. until now i've been a cmd + tab, cmd + ` and cmd + her. (i really only ever used exposé to get to the desktop...) now, i think spaces may clean up my app switching. put the browser in the first space, the ide in the second and the command prompt in the third. now i can just ctrl + arrow between spaces and get right to where i want to be. since spaces aren't in a stack like the app switcher, i don't have to figure out how many cmd + tabs it'll take me to get to where i need to be.

obviously spaces wasn't just designed for developers, but i can't image who will get more use out of it. well, maybe people that want to hide the fact that they're playing launchball all day from their bosses... that's a different story.

i want mustang damnit.

10.17.2007

pie progress bar in safari 3

macosxtips pointed me to this neat little trick. if you want to get a nice little pie chart indicator for page loading instead of the default, just execute

defaults write com.apple.Safari DebugUsePieProgressIndicator -bool true

on the command line. in my opinion, it's a much nicer little indicator.

10.01.2007

coupling

i really enjoy bob lee's blog and somehow or another got back to a post from a while ago about the various degrees of coupling with guice and spring. i'll briefly say that i don't think having to have a jar on the classpath for annotation is that big of a deal and i do think that providing your own version of Inject with source retention is a big hack. that's not really the point though. what bothers me about the whole thing is that colin sampaleanu, who's pretty obviously a spring proponent, gets in a snit about coupling at all. i don't think that i've ever seen code written with spring in mind that didn't use InitializingBean, Assert and *Aware everwhere. regardless of how various versions of java 1.5 handle annotations, you can't compile a thing if the spring interfaces you're implementing aren't there. now, it's certainly possible to write code that's completely spring-agnostic, but look forward to your configuration being even more of a pain than it already was. anyway, i just think that, with regards to coupling, spring is a glass house. it may not be perfect, but at least guice was a step in the right direction.