Search code examples
javaubuntujdbccdata

CData JDBC Driver | java.lang.Exception: Could not find web browser


So I downloaded CData JDBC Driver for Redis from their official site and tried to install it on my system. My system is running Ubuntu 20.04 and I have forcefully uninstalled Firefox a long time ago. So while installing the setup, I am getting this error just before the setup is completed:

java.lang.Exception: Could not find web browser
    at com.izforge.izpack.installer.a.d(Unknown Source)
    at com.izforge.izpack.event.NSInstallerListener.afterPacks(Unknown Source)
    at com.izforge.izpack.installer.UnpackerBase.informListeners(Unknown Source)
    at com.izforge.izpack.installer.Unpacker.run(Unknown Source)

Error in UI

I tried installing on my friend's system, running Windows, it was installed successfully, a pop-up with a list of web-browsers was opened redirecting to the Help Web Page.

I tried copy-pasting the folder installed on my friend's system, but it didn't work. I am getting the following error:

java.sql.SQLException: This system contains a license for CData JDBC Driver for Redis 2021 that has been installed but not activated.  You must run setup to activate the license on this system [code: I nodeid: 3TUTFKAF].
    at XcoreXredisX210X7930.tjc.a(Unknown Source)
    at XcoreXredisX210X7930.tjc.b(Unknown Source)
    at XcoreXredisX210X7930.jvb.execute(Unknown Source)
    at com.cdata.connectors.ConnectorsApplication.main(ConnectorsApplication.java:31)

I also tried reinstalling Firefox, but it didn't help. Is there any workaround for this? Any help is appreciated.


Solution

  • I was facing the same issue a while ago. Turns out CData drivers don't support Google Chrome for Linux Systems:

        public static void d(final String s) throws Exception {
            final String property = System.getProperty("os.name");
            if (property.startsWith("Mac OS")) {
                Runtime.getRuntime().exec("open " + s);
            }
            else if (property.startsWith("Windows")) {
                Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + s);
            }
            else {
                final String[] array = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" };
                String s2 = null;
                for (int n = 0; n < array.length && s2 == null; ++n) {
                    if (Runtime.getRuntime().exec(new String[] { "which", array[n] }).waitFor() == 0) {
                        s2 = array[n];
                    }
                }
                if (s2 == null) {
                    throw new Exception("Could not find web browser");
                }
                Runtime.getRuntime().exec(new String[] { s2, s });
            }
        }
    

    For the driver to be installed successfully, install Opera or another supported browser from the array using Ubuntu Software App.