Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix: OSGi require-capability manifest entry
- Loading branch information
Showing
with
15 additions
and
3 deletions.
-
+14
−2
pgjdbc/src/main/java/org/postgresql/osgi/PGBundleActivator.java
-
+1
−1
pom.xml
|
@@ -29,8 +29,20 @@ public void start(BundleContext context) throws Exception { |
|
|
properties.put(DataSourceFactory.OSGI_JDBC_DRIVER_CLASS, Driver.class.getName()); |
|
|
properties.put(DataSourceFactory.OSGI_JDBC_DRIVER_NAME, "PostgreSQL JDBC Driver"); |
|
|
properties.put(DataSourceFactory.OSGI_JDBC_DRIVER_VERSION, Driver.getVersion()); |
|
|
_registration = context.registerService(DataSourceFactory.class.getName(), |
|
|
new PGDataSourceFactory(), properties); |
|
|
try { |
|
|
_registration = context.registerService(DataSourceFactory.class.getName(), |
|
|
new PGDataSourceFactory(), properties); |
|
|
} catch (NoClassDefFoundError e) { |
|
|
String msg = e.getMessage(); |
|
|
if (msg != null && msg.contains("org/osgi/service/jdbc/DataSourceFactory")) { |
|
|
new IllegalArgumentException("Unable to load DataSourceFactory. " |
|
|
+ "Will ignore DataSourceFactory registration. If you need one, " |
|
|
+ "ensure org.osgi.enterprise is on the classpath", e).printStackTrace(); |
|
|
// just ignore. Assume OSGi-enterprise is not loaded |
|
|
return; |
|
|
} |
|
|
throw e; |
|
|
} |
|
|
} |
|
|
|
|
|
public void stop(BundleContext context) throws Exception { |
|
|
|
@@ -5,7 +5,7 @@ |
|
|
<parent> |
|
|
<groupId>org.postgresql</groupId> |
|
|
<artifactId>pgjdbc-versions</artifactId> |
|
|
<version>1.0.4</version> |
|
|
<version>1.0.5</version> |
|
|
</parent> |
|
|
|
|
|
<artifactId>pgjdbc-aggregate</artifactId> |
|
|