Strange locale things happen under Tomcat/Jasper

I recently installed a webapp which uses tomcat and jasper on one of my server. Everything worked well until a template used some special chars, I got the ‘?’ chars which indicate the typical encoding issue.

Everything seemed correct, DB in UTF-8, virtual machine started with -Dfile.encoding=UTF-8, application in UTF-8, data files in UTF-8.

After an hour spend in all these checks I tried an “export LANG=it_IT.utf8” in my linux environment. Everything worked well.

Where is the point? Very simple, some jar don’t look in the JVM system properties but look for the native locale in the linux enviroment. This causes portability issues and lost of time in solving stupid problems.

NetworkManager no wakeup on Ubuntu

Since the last six months I have an issue with my NetworkManager, sometimes it doesn’t wakup correctly after a standby or suspend.  After some test I found that the problem comes out each time the suspend/standby procedure freezes the system and I have to manually shutdown. To make the NetworkManager the only way is to standby and wakup my laptop.

After several tests I found out what happens and a small workarround.

On my laptop I have an hardware issue with my webcam, the cable which connects the camera to the motherboard throught the monitor is a little bit loose, so sometimes the camera generates an error. This error causes a seg fault in the linux kernel. This seg fault prevents the webcam module to stanby corretly and my laptop freezes during standby cycle. This happens after the NetworkManger has entered the standby cycle in which the network gets disabled.

Now I have to manually power off the laptop, and turning the laptop on again doesn’t run the wakeup cycle,  in the wakup cycle the NetworkManager enables the network again. So my network remains disabled until I run the wakeup cycle.

The first workarround is to standby/wakup the laptop, the second workarround is to run the wakeup command manually:

sudo dbus-send –print-reply –system –dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.wake

I thing this issue comes out each time a suspend/standby isn’t followed by a wakeup (ex: battery runs out) .

Hope this helps others 🙂

WP to LinkedIn Auto Publish Powered By : XYZScripts.com