StreamBase Typecheck NoClassDefFoundError for JDBC Connection

StreamBase Typecheck NoClassDefFoundError for JDBC Connection

book

Article ID: KB0074747

calendar_today

Updated On:

Products Versions
TIBCO Streaming 7

Description

After adding a 3rd-party library to the project Build Path which provides a needed class, the class is still not found and this typecheck error is reported:

 Error connecting to data-source Oracle_11g: Unexpected exception while retrieving JDBC Connection: NoClassDefFoundError: oracle/net/nt/NTAdapter$NetworkAdapterType, JDBCQuery.sbapp, /sample_jdbc-query, Unknown, StreamBase Typecheck Problem

Resolution

In this example, the library is ojdbc7.jar which does supply class oracle.net.nt.NTAdapter$NetworkAdapterType. Oracle reports that ojdbc7.jar is "certified with JDK 8".

StreamBase 7.6 includes the Oracle Java 8 JDK, but the default JDK Compliance setting for the Java Compiler is "1.7" or JDK 7. This prevents the Java compiler from seeing classes from ojdbc7.jar.

To fix this, change the compiler target to "1.8" and save. This setting is under menu:
  Window > Preferences > Java > Compiler, "Compiler compilance level"
Dialog setting for Java Complier compliance level

This change will force a full rebuild of all open projects.

Issue/Introduction

Some 3rd-party libraries require a specific compiler compliance version.