Friday, February 4, 2011

UnsupportedClassVersionError of the OracleDriver when installing Quickr 8.5 on WebSphere Portal

When you want to install IBM Lotus Quickr 8.5 with oracle as an underlying database, you have to specify the driver jar file in the installation wizard.

Now the funny part is that the installation wizard runs with java 6 jre, and will only accept the ojdbc6.jar file (the drivers compiled with java 6) for the drivers. When the ojdbc5.jar is selected, the wizard pops up an error message.

The installation will fail later on with this message in wpinstall.log:
(Feb 2, 2011 2:38:00 PM), Quickr.install, com.ibm.wps.install.ExternalCommandAction$OutputWatcher, msg2, StdOut:      [echo] domain       'release'
(Feb 2, 2011 2:38:00 PM), Quickr.install, com.ibm.wps.install.ExternalCommandAction$OutputWatcher, msg2, StdOut:      [echo] DbtDbDriver  'oracle.jdbc.OracleDriver'
(Feb 2, 2011 2:38:00 PM), Quickr.install, com.ibm.wps.install.ExternalCommandAction$OutputWatcher, msg2, StdOut:      [echo] DbtDbLibrary 'C:/drivers/oracle/ojdbc5.jar'
(Feb 2, 2011 2:38:00 PM), Quickr.install, com.ibm.wps.install.ExternalCommandAction$OutputWatcher, msg2, StdOut:      [echo] DbtDbUser    'quickr'
(Feb 2, 2011 2:38:00 PM), Quickr.install, com.ibm.wps.install.ExternalCommandAction$OutputWatcher, msg2, StdOut:      [echo] DbtDbUrl     'jdbc:oracle:thin:@localhost:1521:QUICKR'
(Feb 2, 2011 2:38:00 PM), Quickr.install, com.ibm.wps.install.ExternalCommandAction$OutputWatcher, msg2, StdOut:      [echo] DbtDbName    'QUICKR'
(Feb 2, 2011 2:38:00 PM), Quickr.install, com.ibm.wps.install.ExternalCommandAction$OutputWatcher, msg2, StdOut:      [java] Exception in thread "main" java.lang.UnsupportedClassVersionError: (oracle/jdbc/OracleDriver) bad major version at offset=6

 This clearly indicates that te OracleDriver class is not of the desired version. The underlying WebSphere Portal for the Quickr will use a java 5 runtime.

Now how can we use the ojdbc5.jar driver package during the installation? A good ol' switcheroo of files will do the trick! Rename the ojdbc6.jar driver to ojdbc5.jar, select that file in the wizard, and when you arrive on the summary screen of the wizard (before the installation starts), you replace the renamed ojdbc5.jar by the real ojdbc5.jar.

We fooled the wizard, the installer will use the correct oracle drivers.