No class found exception in OSGi for org.osgi.service.jdbc.DataSourceFactory

Description

java.lang.IllegalArgumentException: Unable to load DataSourceFactory. Will ignore DataSourceFactory registration. If you need one, ensure org.osgi.enterprise is on the classpath
at org.postgresql.osgi.PGBundleActivator.start(PGBundleActivator.java:38)
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2154)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2072)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/osgi/service/jdbc/DataSourceFactory
at org.postgresql.osgi.PGBundleActivator.start(PGBundleActivator.java:33)
... 6 more
Caused by: java.lang.ClassNotFoundException: org.osgi.service.jdbc.DataSourceFactory not found by org.postgresql.jdbc42 [65]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1993)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more

This was an exception in output.log after upgradung from 1.12.

Environment

https://mynms.opennms.com/Ticket/Display.html?id=5768

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Chandra Gorantla September 3, 2019 at 7:15 PM

Backported to foundation-2017: https://github.com/OpenNMS/opennms/pull/2680

Jesse White July 31, 2019 at 6:52 PM

This needs backporting to foundation-2017.

Jeff Gehlbach September 13, 2018 at 3:35 PM
Edited

This problem also impacts all releases of Meridian 2017 so far; we just took a support ticket on it. I'm reopening and adding to affected versions. If it's a zero-impact problem that we can deal with an item in the release notes, that's great; I can't really tell from the issue history whether that's the case.

Seth Leger July 17, 2017 at 3:13 PM

This was fixed by adding the Pax JDBC API to our postgresql feature. Our postgresql Karaf feature is now the same as the Pax JDBC version. We could migrate to the Pax JDBC feature instead of writing our own but that would make it more difficult to bump the version of the postgresql driver so maybe we should keep our version separate.

commit c62e59c1bc31a8af782f6dfd453ee8027e220f5a

Fixed

Details

Assignee

Reporter

Components

Sprint

Affects versions

Priority

PagerDuty

Created May 11, 2017 at 3:31 AM
Updated September 4, 2019 at 9:39 PM
Resolved September 4, 2019 at 9:39 PM