SAP Knowledge Base Article - Preview

2902096 - jConnect fails to load driver using getSystemClassLoader - SDK for SAP ASE

Symptom

  • Regression issue when loading our driver from a file lookup:
    method.invoke(ClassLoader.getSystemClassLoader(), new Object[]{file.toURI().toURL()});
  • Exception in thread "main" java.lang.NoClassDefFoundError: com/sybase/jdbc4/jdbc/SybDriver : cannot initialize class because prior initialization attempt failed
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forNameFW(Class.java:362)
    at java.lang.Class.forName(Class.java:355)
    at java.sql.DriverManager.isDriverAllowed(DriverManager.java:556)
    at java.sql.DriverManager.getConnection(DriverManager.java:661)
    at java.sql.DriverManager.getConnection(DriverManager.java:270)
    Caused by: java.lang.ExceptionInInitializerError: java.lang.ExceptionInInitializerError
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:456)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
    at java.util.ServiceLoader$LazyIterator.access$700(ServiceLoader.java:323)
    at java.util.ServiceLoader$LazyIterator$2.run(ServiceLoader.java:407)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:409)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at java.sql.DriverManager$2.run(DriverManager.java:603)
    at java.sql.DriverManager$2.run(DriverManager.java:583)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.sql.DriverManager.loadInitialDrivers(DriverManager.java:583)
    at java.sql.DriverManager.<clinit>(DriverManager.java:101)
    at DriverInitializer.main(DriverInitializer.java:35)
    caused by: java.lang.NullPointerException: permission can't be null
    at java.security.AccessController.checkPermission(AccessController.java:857)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at java.sql.DriverManager.deregisterDriver(DriverManager.java:402)
    at com.sybase.jdbc4.jdbc.SybDriver.registerWithDriverManager(SybDriver.java:730)
    at com.sybase.jdbc4.jdbc.SybDriver.<init>(SybDriver.java:141)
    at com.sybase.jdbc4.jdbc.SybDriver.<clinit>(SybDriver.java:105)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:456)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
    at java.util.ServiceLoader$LazyIterator.access$700(ServiceLoader.java:323)
    at java.util.ServiceLoader$LazyIterator$2.run(ServiceLoader.java:407)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:409)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at java.sql.DriverManager$2.run(DriverManager.java:603)
    at java.sql.DriverManager$2.run(DriverManager.java:583)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.sql.DriverManager.loadInitialDrivers(DriverManager.java:583)
    at java.sql.DriverManager.<clinit>(DriverManager.java:101)


Read more...

Environment

  • SAP Adaptive Server Enterprise (ASE) Software Developer Kit (SDK) 16.0 SP03 PL06
  • jConnect
    • JDBC 7.07
    • JDBC 16 ( is version JDBC 7.07 )
  • java

Product

SAP Adaptive Server Enterprise 16.0 ; SAP Adaptive Server Enterprise SDK 16.0

Keywords

CR#821234, CR821234, CR# 821234, load, classpath, , KBA , BC-SYB-SDK , SDK , Bug Filed

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.