Friday, October 09, 2009

java.io.IOException: Not enough space

Seen that?
Caused by: java.io.IOException: error=12, Not enough space
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:53)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)

Yes, I hate this too. First of all, that's not what you think. It means not enough swap, because your Java suddenly wants lots of GB of memory. When Java launches fork, it starts a new VM as a fork from current process. Thus for a short period between fork and exec, there is two instances of your stuff. That's temporary though. Exactly at this moment your system cries for a lack of swap.

Now, how to cure this on Solaris as long as you're using old UFS. Simply add some space as a file to a swap:
mkfile 500m /opt/var/my.swap
swap -a /opt/var/my.swap
Uhm, OK. That's old way... But that won't work on ZFS as this file system can not use files for a swap. :-) To use this with ZFS, make another ZFS filesystem in your rpool. That's how I am using in my OpenSolaris global zone:
zfs create -V 2G rpool/additionalswap
swap -a /dev/zvol/dsk/rpool/additionalswap
To see the result, issue swap -l command and it will show you that new FS has been added to your swap, something like this:


swapfile dev swaplo blocks free
/dev/zvol/dsk/rpool/swap 182,1 8 2095096 1823456
/dev/zvol/dsk/rpool/additionalswap 182,3 8 4194288 4194288

Now you're safe. :-)

GlassFish + OpenDS = No Pain

You want LDAP and appserver work with it. But you also remember all the voodoo bloody massacre you've experienced, once you've tried to setup OpenLDAP and now looking to shoot its developers. Calm down, go an elegant and easy way instead.

My config is pretty much simple OpenDS on an OpenSolaris zone. Nothing special for OpenSolaris zone — just setup it as usual and configure OpenDS as you would do on a global zone. That's my scenario:

  1. Login to your OpenSolaris global zone and install OpenDS from IPS:

    pfexec pkg install opends

  2. Now, login to your zone where OpenDS is supposed to run and add an user, who will use it. In my case it is "opends" user (and a same group) and I've decided to put it separately, where entire OpenDS instance is:

    pfexec useradd -md /opt/opends/home opends

  3. I've also decided that OpenDS instance is running in /opt/opends/instance folder. So run configuration against "opends" user and that folder like this:

    pfexec /usr/opends/configure \
         --instancePath /opt/opends/instance \
         --userName opends \
         --groupName opends


  4. Great. Now is a time to finish it. :-) Login as "opends" user and run "setup" command. Please note, it will try run Swing GUI for you, so either SSH into your box with X11 forwarding or use command line mode ("--cli" option) and follow these few simple instructions (setup DN, admin password, port etc):

    /usr/opends/setup --cli

  5. There is no fifth step — your LDAP is up and running. Need more info about details and such? Here: https://docs.opends.org/wiki — depending on your version...

OK, we have LDAP done in four steps. Now we want GlassFish use it as realm. That's also elegant:

  1. Login into your GlassFish admin console (by default on 4848 port).
  2. Go to Configuration → Security → Realms and add one just straight-forward as it is:
    1. Set name to "OpenDS", let's say.
    2. Use class: com.sun.enterprise.security.auth.realm.LDAPRealm
    3. Set JAAS context as "ldapRealm"
    4. Set Directory to "ldap://your.host:port". If you're using SSL to make things thrice slower while no much change to security itself (because it is an internal network), then use scheme "ldaps://...". :-)
    5. Use your base DN that you've put to your LDAP, e.g.: dc=your,dc=host,dc=com or something like this.
    6. And then use your group whenever it is: ou=groups,dc=your,dc=host,dc=com etc.
  3. There is no third step.

Easy, is it? :-)

Thursday, October 01, 2009

IT Market Nowadays


Here I just thought how job specification would look like, if IT guys would need to drive a regular city bus. :-)


Job Specifications

City bus driver from 9:30AM to 3:30PM.

Job Type

contract, part time.

Salary

Negotiable, but no more than $1000 per month.

Requirements

Bicycle skydiving, motorcycle, car and truck licenses, repair and maintenance knowledge, tramway and trolley-bus at least 5 years experience. Additionally, ultra-high demolition excavators such as Caterpillar 385D operation, haulage and earthmoving equipment on off-road vehicles experience, military armored bulldozer D9, rocket launcher truck and tank Abrams driving at least 1 year experience.

Successful candidate also should have knowledge flying F16, PhD in engine manufacturing and engineering, license for shooting magnum .44 gun and must have at least 5 (five) jumps with a parachute.

Having 500 hours flight as a crew captain with Boeing 747 is a plus. Being an astronaut team leader with at least month in a space is a plus. Knowing some specific details about Apollo 13 and landing on a Moon is a plus, but not that much necessary, however it might affect salary negotiations.

If you are interested, we are waiting you for an interview. You will have 10 interviews, 4 tests and 2 brainbench in a gym.

Other notes

You must not be married.