This forum has been archived. Please start a new discussion on GitHub.

Android and ICE properties file

Im creating an Android application that will use an ICE properties file. The file is being read in like this:

private SessionFactoryHelper factoryHelper;
private SessionHelper sessionHelper;
Ice.InitializationData initData = new Ice.InitializationData(); = Ice.Util.createProperties();"/dev/ice.cfg");
factoryHelper = new SessionFactoryHelper(initData, this);

I am ussing Glacier2 and SSL so I have these properties set in my properties file:

I'm using a SessionFactoryHelper to connect to my Glacier2 router:
sessionHelper = factoryHelper.connect(uname, pass);

Problem is I can't get it to connect to the router, when I call connect on factoryHelper it throws:

reason = "IceSSL: unable to load keystore:

I manually pushed all the certificates to the Android emulator using adb, and they exist under /dev/ice_certs because if I look on the file system on the Android emulator I can see the files. The permissions on the files are also correct.

Also I know the /dev/ice_certs mount is accessible because if I change the IceSSL.DefaultDir property to some garbage mount such as "/bogusmout/ice_certs" the exception thrown by the connect function changes to:
reason = "IceSSL: keystore not found:

Which means that in the previous case the client.jks was being found but wasn't loadable for some reason.

Any ideas?



  • xdm
    xdm La Coruña, Spain

    Seems that you missed a slash at the beginning of this property value
  • I have tried that already also. I get the same exception.
  • xdm
    xdm La Coruña, Spain
    This indicate an IOException. You can get more info from the exception cause.

    Try to catch the exception and print the cause stack trace.
    catch(Ice.PluginInitializationException ex)
  • Looks like a problem with my keys, this is what the stack trace said: Wrong version of key store.
  • xdm
    xdm La Coruña, Spain
    Seems that you need to set the properties


    The default depends on the JVM, valid values are "JKS", "PKCS12" and "BKS"

    Also note that IceSSL require using Android Froyo or later. See Ice Android demos for examples of how to conditional configure IceSSL
  • xdm
    xdm La Coruña, Spain
    Also note that Android don't support JKS, you should use BKS instead
  • Yup that is the problem my key store is in JKS format.