Skip to main content

Posts

Tomcat and the web.xml's webapprootkey

I n my company, I have to deal with many Spring based applications deployed on a Tomcat cluster. For each one, we set a property 'webapprootkey' in the web.xml file to avoid errors on startup. Today, I decided to dig about that (... erratum... I decided to tell Google to dig about that). Thus, I found this excellent post.

http://groups.google.com/group/riotfamily/browse_thread/thread/9a0edf69575d3ab6?pli=1

Hi all,

when deploying two applications build from the riot skeleton within the same Tomcat servlet container, you get an IllegalStateException: Web app root system property already set to different value: 'webapp.root' = [/Users/joe/Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/webapp-A/] instead of [/Users/joe/Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/webapp-B/] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!

I will try to explain where this comes from and how …

How to fix mouse click problem on flash player 64 bits with Ubuntu 9.10

I just write here some informations I found on the web. On my Linux Ubuntu 9.10 64 bits, the flash plugin sometimes doesn't register mouse clicks. To fix it, edit the following file by doing :
sudo gedit /usr/lib/nspluginwrapper/noarch/npviewer
and add this export
export GDK_NATIVE_WINDOWS=1
like this
#!/bin/sh # # nsplugin viewer wrapper script... OS="`uname -s`" ARCH="`uname -m`" NPW_LIBDIR="/usr/lib/nspluginwrapper" export GDK_NATIVE_WINDOWS=1
if test -z "$TARGET_OS"; then ...
Enjoy!

PHP Tips : converting legacy content into UTF-8

Today, we have encoding problems with legacy apps written in PHP. After some discussions and some googlings, I found this interesting post :
http://www.sitepoint.com/blogs/2008/09/10/issues-with-cultural-integration/
You can read in it : Latin1 on the inside, utf-8 on the outsideEmbed utf-8 within latin1I copied-pasted just a few lines of code :
// declare that the output will be in utf-8 header("Content-Type: text/html; charset=utf-8"); // open an output buffer, capturing all output ob_start('output_handler'); // when the script ends, the buffer is piped through this functions, encoding it from latin1 to utf-8 function output_handler($buffer) { return utf8_encode($buffer); }
Excellent!

A script I found to install Flash on Ubuntu 9.10 64bits

#!/bin/bash # Script created by # Romeo-Adrian Cioaba romeo.cioaba@spotonearth.com # Super minor updates by jason.melton[at]gmail[dot]com # Updates by Alejandro Cuervo 3[at]cuervo[dot]net # more very minor updates by damien[at]groovey[dot]com # Released under GPL
echo "Closing Firefox" sudo killall -9 firefox
echo "Downloading and instaling Getlibs for required libraries" wget http://www.boundlesssupremacy.com/Cappy/getlibs/getlibs-all.deb sudo dpkg -i getlibs-all.deb
echo "Removing previous installs of flash:" sudo apt-get remove -y --purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper sudo rm -f /usr/lib/mozilla/plugins/*flash* sudo rm -f ~/.mozilla/plugins/*flash* sudo rm -f /usr/lib/firefox/plugins/*flash* sudo rm -f /usr/lib/firefox-addons/plugins/*flash* sudo rm -rfd /usr/lib/nspluginwrapper
echo "Installing ia32-libs and nspluginwrapper" sudo apt-get install ia32-libs nspluginwrapper
echo "Get…

I realized I was a "ScrumButt" Master

I've just finished the two days long training session to be a Scrum Master. These two days were lead by Jeff Sutherland (in collaboration with Xebia France) . Of course, don't imagine that you will be great a Scrum Master at the end of the session. As Jeff said, were you a good driver just after obtaining youri driving license?

In this post, I will try to summarize notes I took during the course. It's not exhaustive but it wil give you a global idea of what is Scrum and what should do a Scrum Master.

But, before starting, let's return to the title of this post : "I realized I was a ScrumButt Master". Humm... what's that? Jeff said something very interesting . He asked people about who had already tried Scrum. Many ones in the assistance raised their hand. So, why were they here? ... Ok, let's do another test : can you give me the average velocity of your team? Only two answers iin allt the room. And that's why I was here. As many people, I tried Scr…

Use exotic Maven repositories with your local mirror

This is a little tip you must know if you have an "in-house" maven repository mirros (such as Artifactory) and if you want to access to an exotic one.

What's an exotic repository? My definition of that is a repository hosted by a developer isolated somewhere on the web. Of course, it's not a mirror of the official one. By the way, you should not declare it on you "in-house" mirror but simply write the following lines in your pom.xml :

<repositories>
<repository>
<id>violet.repo</id>
<name>Violet's Maven repository (public access)</name>
<url>http://violet.sourceforge.net/maven2/repo/</url>
</repository>
</repositories>



Now, imagine you try to retrieve an artefact. Muupp... error! You miss to declare an exclusion in your settings.xml to inform Maven that it should not use your local mirror to get it. Thus, this is an example of what to do :

<mirrors>
<mirror>

Speed Up your FireFox on Linux

You can't imagine how Firefox loves to write temporary files. I realized it on my Acer Aspire One with its ugly 8GB SSD. An excellent tip I read on the web consists in mounting a directory in memory and configuring FF to use it.

Let's go :

sudo gedit /etc/fstab

Add the following line :

tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

In Firefox, open this internal URL :

about:config

Right click to add a new string entry :

browser.cache.disk.parent_directory

Set its value to

/tmp

Reboot your machine and appreciate...

Of course, this tip is certainly portable on Microsoft Windows with softwares like RamDrive even if I presented it on Linux.

Installing an Apache Tomcat cluster

I'm currently reviewing some scripts to install a Tomcat cluster. A nice way to do that is to have a common Tomcat installation and the minimum needed for each node. There's a an excellent introduction on the subject by Filip Kanik :

http://www.springsource.com/webinar/large-scale-tomcat-deployments

Then, you will find here an example of the run.sh file introduced by Filip :

http://sirinsevinc.wordpress.com/2009/07/20/deploying-multiple-tomcat-instances/

Where is my Tomcat Adapter for WTP in Eclipse 3.5 (Galileo) ?

I downloaded Galileo a few days ago. But, when I tried to test my webapp on my favourite Tomcat, I discovered that it missed the corresponding adapter. Wooo... After some searches (thanks to Google), I found the easiest way to install it and (by the way) all the other adapters. From the WTP update site (http://download.eclipse.org/webtools/updates/), select and install JST Server Adapters.

That's all!

Move a project from an SVN repository to another one

Today, I need to move a project from a first subversion repository to a second one. To do that, you need to have an access to your SVN server.

So, we will use the following commands :
svnadmin dump to backup the repositories (I insist on 'repositories'. I think it's important to have backups of all repos before doing such operations)svndumpfilter to reduce the backup scope to a single project because the dump can only be done on the entire SVN repositorysvnadmin load (I think you can guess what this wonderful command does)To understand this commands, it's important to know that svnadmin uses standard inputs and outputs. Thus, we can combine commands with pipes.


Let's save our project (with all its history, tags, branches...)

svnadmin dump /home/subversion/svn/repo/ | svndumpfilter include myproject > svn.myproject.dump

Now, let's backup our target repository :

svnadmin dump /home/subversion/svn/new_repo/ > svn.new_repo.dump

And let's import the project on th…

Modify your host networking interface with Virtual Box OSE 2.0.4

In the previous post, I talked about how to start a Windows XP image downloaded from Microsoft to be able to test your web application with Internet Explorer.

On Ubuntu 8.04 and Virtual Box OSE (Open Source Edition) 2.0.4, there are some fixes to do before being able to work with the hosted mode network interface.

I took the following instructions from the french Ubuntu forum (http://forum.ubuntu-fr.org/viewtopic.php?id=217680).

1) install bridge-utils and uml-utilities (sudo apt-get)
2) add the vboxusers usergroup to your user :

$ sudo usermod -a -G vboxusers

3) Create a bridge by modifying you /etc/network/interfaces file

For DHCP conf

$ sudo gedit /etc/network/interfaces
auto eth0
iface eth0 inet manual

auto breth0
iface breth0 inet dhcp
bridge_ports eth0

# The loopback network interface
auto lo
iface lo inet loopback

For static IP conf

$ sudo gedit /etc/network/interfaces
auto eth0
iface eth0 inet manual

auto breth0
iface breth0 inet static
bridge_ports eth0
address 192.168.0.2
netmask 255.25…