ClassFormatError when trying load InterClient

By: Quinn Wildman

Abstract: This error occurs when attempting to use InterClient version prior to 2.x with Java 2

InterClient versions included with InterBase prior InterBase 6 do no work with JDK 1.2 or later. If you run the CommDiag sample application from a web browser you get following error when connecting to an InterBase database:

SQL State: ICJE2
Error Code: 1
Message: [interclient] Communication error: A socket exception occurred while trying to establish a socket connection to server localhost. The message of the SocketException is "Connection refused".
See API reference for exception
interbase.interclient.CommunicationException

If you attempt to run the CommDiag sample application from the command line it will result in the following error:

Exception in thread "main" java.lang.ClassFormatError: interbase/interclient/uti ls/CommDiag (Local variable name has bad constant pool index)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:492)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:11 1)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$1(URLClassLoader.java:214)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:189)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:290)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)

There are two ways to resolve this problem.

1. Get an earlier version of Java (1.x).
2. Get a later version of InterBase, which includes a later version of InterClient.

Server Response from: ETNASC03