Wednesday, January 14, 2009

Enable Java applets for Firefox on Linux

I assume that you use the default Firefox and apt-get setup.

1. Test if your browser supports Java applets here:

Java tester

2. If your browser "can NOT run Java applets", then install the Java runtime environment:

sudo apt-get install sun-java6-jre

3. Create the plugins directory:

mkdir -p ~/.mozilla/plugins

4. Link the plugin from the JRE installation to the plugins directory:

ln -sf /usr/lib/jvm/java-6-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so ~/.mozilla/plugins

If your JRE got installed somewhere else, then look up the libjavaplugin_oji.so and link that file.

5. Add to ~/.bashrc:

MOZ_PLUGIN_PATH=$HOME/.mozilla/plugins
export MOZ_PLUGIN_PATH

If your default shell is not bash, then set this variable accordingly, in the startup script of that shell.

6. Log out and back, and start Firefox. Check if the installation is correct using the link at the top.

External access of a server behind Orange Sagem Livebox

To open a service behind the Livebox Sagem, do the following. I use SSH as example, with port 22, and I assume that you use the default configuration of the modem.

1. Open an account at dyndns.org (I assume you know what it is, or you can figure it out. It provides you a free, fix DNS name that can "follow" the changing IP address of the modem).

2. Log in the modem as admin (default password: admin) from a machine that is behind the modem:


3. Set up the dyndns access properties. Select the Advanced Menu -> Network -> DynDNS drop-down menu item. Add your dyndns user name, password and the DNS name that you selected. Press Apply, then Update Now to see if the DynDNS access is OK. You should see the green "Updated - IP updated successfully" line.
4. Now, you have two options. If you want to access the services of only one server, then you can make that particular server fully visible to the world by using DMZ. Mind that it is unsafe, because the firewall in the Livebox will not protect that machine. If you want this, then select the Advanced Menu -> Firewall -> Policies menu item, then click on DMZ host. Add the local IP address of the server, and check the checkbox. Press Apply. Done.
5. If you have more servers, or you want to protect your server with the Livebox firewall (recommended), then you must specify the services one-by-one. Select Basic Menu -> LAN Servers. At the bottom of the table, click on New Entry
  • Give a name to the service (arbitrary)
  • Access activated: yes
  • From port: 22 (the SSH server will be available on _your_dyndns_name_:22 for the world)
  • To  port: the SSH port of the SSH server (22)
  • Local IP address: the address of the server
Press Apply, and you are done.

Mind, that for an unknown reason, you cannot access the services with the dyndns name behind the Livebox. Try if from a real external machine (ex. ssh to an external server, and try ssh back to your server).


Monday, January 12, 2009

InvocationTargetException with the Apache Axis2 Eclipse plugin

If you have to use Axis2, and work with Eclipse, it is worth to try this tool:

Code Generator Wizard Guide for Eclipse Plug-in

If you encounter the following problem:



then it means that not all the necessary jar files are available: either not packaged in the plugin download or they are missing from the plugin.xml.

Do the following (this particular solution worked for me, this or a similar one should also work for you):

1. Download the following jar files:

stax-api-1.0.1.jar
backport-util-concurrent-3.1.jar

and save them to eclipse/plugins/[Axis2 Codegen Wizard]/lib (replace [Axis2 Codegen Wizard] with the real plugin directory).

2. Add to the eclipse/plugins/[Axis2 Codegen Wizard]/plugin.xml the followings (to the <runtime> element), if they are missing:

<library name="lib/stax-api-1.0.1.jar">
<export name="*"/>
</library>


<library name="lib/backport-util-concurrent-3.1.jar">
<export name="*"/>
</library>


3. Restart Eclipse:

eclipse -clean

If you still have problems, then open eclipse/plugins/[Axis2 Codegen Wizard]/plugin.xml, and figure out which jar files are still missing. Use http://findjar.com/ for download locations of the missing files.

Links discussing the same problem:

Developing Web Services Using Apache Axis2 Eclipse Plugins

Blogs from Iterox - used this method to track down the problem