java.io.IOException: empty AVA in RDN
I get this error in the morning and eat me 1 hour from my life. I tried to install a glassfish on a new server (installed by some other third party) and ant finished with this error:
keytool error: java.io.IOException: empty AVA in RDN “”
when is trying to create domain1.
First I looked to glassfish and after at keytool from java. I tried several java JDK, but no chance … the same error spoted again and again. At a moment I “debugged” create domain command
strace -fff -s 128 ../asadmin create-domain –adminport 4848 –instanceport 8080 –user admin –passwordfile /home/user/glassfish/passfile –domainproperties orb.listener.port=3700:jms.port=7676:http.ssl.port=8181 –savelogin domain1
strace help me to extract the keytool command what asadmin create-domain is calling:
keytool -genkey -keyalg RSA -keystore /home/user/glassfish/domains/domain1/config/keystore.jks -alias s1as -dname “CN=dev.randombugs.com,,OU=Sun GlassFish Enterprise Server,O=Sun Microsystems,L=Santa Clara,ST=California,C=US” -validity 3650 -keypass changeit -storepass changeit -J-Dsun.security.internal.keytool.skid
When I looked very closer at keytool command parameters I spotted two commas after CN parameter. After I removed 1 of them keytool worked perfectly. So the problem is comming from my hostname (or /etc/hosts). When I checked /etc/hosts I saw a line something like:
127.0.1.1 dev.randombugs.com, dev
After I removed the stupid comma from /etc/hosts glassfish installation worked perfectly.
So this error just appear because of a misspelled host name and it can appear if any parameter from “distinguish name” is misspelled. So just take care how is your host configured.