Monday, November 9, 2009

Tomcat and Wicket's unruly logging

Note: if you want the solution just skip to the end...

Like many before me, I too ran into the problem where wicket was spamming log message into "catalina.out".

At first, naively, I tried to change my log4.properties file, but alas, wicket seemed intent on ignoring these changes. Following that failure, I tried changing Tomcat's logging.properties but that didn't seem to effect wicket's either.

Frustrated and naturally lazy I turned over to Google, the almighty human knowledge repository. If you know what to feed in that little search box, Google can save you loads of time and also the effort of actually understanding what is it you are doing (so basically good googling skills are essential to the indolent).

In this case however, this wonderful "googelazy" phenomenon was in fact hindering my efforts. Once I realized my salvation will not be so easy, I went on to read the documents of the logging lib used by Wicket: slf4j.

After perusing the documentation for a while I ran into this:


So I've decided to check my classpath and see which implementation I'm using. It turns out I was using slf4j-simple.jar which outputs everything to System.err:

slf4j-simple-1.5.9.RC1.jar
Binding for Simple implementation, which outputs all events to System.err. Only messages of level INFO and higher are printed. This binding may be useful in the context of small applications.

The solution was simple after that, replace the slf4j-simple.jar with something else, in my case it was the slf4j-log4j12.jar

Sub conclusion: if the answer was googlable it would have poped up straight away, next time I should rtfm

Thursday, October 22, 2009

Thursday, May 7, 2009

Dub FX

This human beatbox artist is just amazing. His music is really unique and refreshing!

Make some noise :-)




Checkout his website too: http://www.dubfx.net/

Wednesday, March 25, 2009

My company's new website

http://www.codeark.com

comments will be happily accepted! :)

(even negative ones, just be gentle...)

Saturday, March 14, 2009

Wicket, Ajax, UTF-8 and Tomcat connectors

While working on one of my backoffice applications, I stumbled upon a problem where hebrew text would turn into encoded gibberish after inputing it into an ajax editable control (like AjaxEditableLabel or AjaxEditableMultiLineLabel).

After looking around in wicket's ajax debug console I found out that the problem was on the server side, quick googling action turned out the following possible problem/solution, the tomcat connector's declaration is missing a URIEncoding attribute:
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"
URIEncoding="UTF-8"/>
Original post here

I was very happy its a simple solution and was almost 100% this would solve the problem, However, it didn't do the trick! why?!

Well, My tomcat sits behind an apache httpd server (proxy), because I like to complicate things sometimes (and because my server is a hybrid serving php, java, python perl and so on). Now, apache and tomcat communicate via AJP protocol, so the URIEncoding attribute should be present for that connector declaration as well:
<Connector
server="Apache PowerCore"
port="8009"
protocol="AJP/1.3"
URIEncoding="UTF-8" />
For the sake of computer voodoo, I left the encoding attribute in the http connector as well. Computer voodoo is a powerful thing :)

Thursday, January 1, 2009

Pour your own pint

Just had to share with you this small bit of information a friend has told me about, last night he along with 19 other people booked a table at a bar in Cork City, Ireland, where you get a table with your own personal beer tap(s)! How awesome is that ?!

The special taps measure how much beer you pour, so you can pay accordingly later...

Check it out: Soho bar website