question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pgjdbc karaf feature file is broken starting with 42.2.13

See original GitHub issue

I’m submitting a …

  • [X ] bug report
  • feature request

Describe the issue Installing the feature creates a stack trace and terminates ongoing ssh connections.

Sometimes ssh is completely broken and a karaf restart is necessary to get it working again

Driver Version?

42.2.13 through 42.2.16

42.2.12 is the last one that works.

Java Version?

openjdk 11.0.8

OS Version?

debian 10.5 “buster”

PostgreSQL Version?

12.4

To Reproduce Steps to reproduce the behaviour:

  1. download the latest karaf and unpack and start it
  2. From the command line add the postgresql feature repository and install the feature
feature:repo-add mvn:org.postgresql/postgresql/42.2.13/xml/features
feature:install postgresql

After a little while the following stack trace appears:

 org.apache.karaf.deployer.features [org.apache.karaf.deployer.features.osgi.Activator] ERROR : Invalid BundleContext.
java.lang.IllegalStateException: Invalid BundleContext.
        at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
        at org.apache.felix.framework.BundleContextImpl.addBundleListener(BundleContextImpl.java:211)
        at org.apache.karaf.deployer.features.FeatureDeploymentListener.init(FeatureDeploymentListener.java:89)
        at org.apache.karaf.deployer.features.osgi.Activator$DeploymentFinishedListener.deploymentEvent(Activator.java:86)
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.callListeners(FeaturesServiceImpl.java:321)
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1068)
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

Expected behaviour A clear and concise description of what you expected to happen.

The feature should install without any error message or ssh breakage.

And what actually happens

If installing directly from the console started with karaf the above stack trace appears.

If installing from an ssh session the ssh session is torn down and may occasionally require a karaf restart before ssh starts working again.

Logs If possible PostgreSQL logs surrounding the occurrence of the issue Additionally logs from the driver can be obtained adding

loggerLevel=TRACE&loggerFile=pgjdbc-trace.log 

to the connection string

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
davecramercommented, Oct 9, 2020

Fixed in 42.2.17

0reactions
steinarbcommented, Sep 29, 2020

Dave Cramer notifications@github.com:

Do you know how to get Karaf to use a local maven repo?

By default karaf uses the local maven repo of the user karaf is started as.

So if the integration test was part of a reactor build, you could e.g. replace the explicit pgjdbc.version in the pom with project.version and start the feature of the current snapshot.

Or you could remove the @Configuration stuff in the test and instead do this: addFeaturesRepository(“mvn:org.postgresql/postgresql/LATEST/xml/features”); installAndAssertFeature(“postgresql”);

NB! Not tested! But this should try installing the most recent snapshot from the local repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pgjdbc karaf feature file is broken starting with 42.2.13 #1891
So a minimum fix would be to get rid of loading the old osgi bundles. (I provided the original karaf feature built with...
Read more >
Apache Karaf Container 4.x - Documentation
Here is a short list of provided features: Hot deployment: simply drop a file in the deploy directory, Apache Karaf will detect the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found