Friday, April 13, 2012

Adding CXF runtime environment to Eclipse

Another quick tip for JAX-WS development in Eclipse:

When adding a CXF-Runtime via Window->Preferences->CXF 2.x Preferences don't forget to set a checkmark to the left of the entry, otherwise Eclipse won't use the environment and will complain about a missing CXF jar.

Export Java Libraries into WAR file

Just deployed my first JAX-WS web service with external libraries (SMACK in my case) in Eclipse and discovered, that to get the libraries into the exported WAR one has to add them via Properties->Deployment Assembly) of the web project. Adding them to exported libraries in the build path view doesn't have the desired effect.

Thanks goes to Thorbjørn who answered the question on Stackoverflow.

Openfire doesn't start

Just downloaded the latest release of Ignite Realtime's Openfire XMPP server. They also provide a .deb package besides .tar.gz, so I chose to use it. After installing I tried to start the server by executing

/etc/init.d/openfire start

But nothing happened.


So I further inspected the code of the script and found out, that it only checks for old Java versions:

if [ -z $JAVA_HOME ]
then
t=/usr/lib/jvm/java-1.5.0-sun && test -d $t && JAVA_HOME=$t
t=/usr/lib/jvm/java-6-sun && test -d $t && JAVA_HOME=$t
fi


But my Java version java-7-oracle was missing. So I simply added it at the end:

if [ -z $JAVA_HOME ]
then
t=/usr/lib/jvm/java-1.5.0-sun && test -d $t && JAVA_HOME=$t
t=/usr/lib/jvm/java-6-sun && test -d $t && JAVA_HOME=$t
t=/usr/lib/jvm/java-7-oracle && test -d $t && JAVA_HOME=$t
fi


which allowed the script to run properly.