Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.eclipse.jgit.http.apache does not import javax.net.ssl! #1

Closed
pkriens opened this issue Dec 1, 2023 · 1 comment
Closed

org.eclipse.jgit.http.apache does not import javax.net.ssl! #1

pkriens opened this issue Dec 1, 2023 · 1 comment
Milestone

Comments

@pkriens
Copy link
Contributor

pkriens commented Dec 1, 2023

At bndtools we got bndtools/bnd#5908

Analyzing how it is possible that JGit cannot find the javax.net.sll.SSLContext class, I looked at the bundle org.eclipse.jgit.http.apache where the error occurred.

[MANIFEST]

Automatic-Module-Name                   org.eclipse.jgit.http.apache
Build-Jdk-Spec                          11
Bundle-ActivationPolicy                 lazy
Bundle-Localization                     plugin
Bundle-ManifestVersion                  2
Bundle-Name                             %Bundle-Name
Bundle-RequiredExecutionEnvironment     JavaSE-11
Bundle-SymbolicName                     org.eclipse.jgit.http.apache
Bundle-Vendor                           %Bundle-Vendor
Bundle-Version                          6.3.0.202209071007-r
Created-By                              Maven Jar Plugin 3.2.0
Export-Package                          org.eclipse.jgit.transport.http.apache.internal;x-internal:=true
                                        org.eclipse.jgit.transport.http.apache;version="6.3.0"; uses:="org.apache.http.client,  org.eclipse.jgit.transport.http,  org.apache.http.entity,  org.apache.http.client.methods,  javax.net.ssl,  org.eclipse.jgit.util,  org.apache.http"
Implementation-Title                    JGit org.eclipse.jgit.http.apache
Implementation-Vendor                   Eclipse.org - JGit
Implementation-Vendor-Id                org.eclipse.jgit
Implementation-Vendor-URL               https://www.eclipse.org/jgit/
Implementation-Version                  6.3.0.202209071007-r
Import-Package                          org.apache.http.client.config;version="[4.4.0,5.0.0)"
                                        org.apache.http.client.methods;version="[4.4.0,5.0.0)"
                                        org.apache.http.client.params;version="[4.4.0,5.0.0)"
                                        org.apache.http.client;version="[4.4.0,5.0.0)"
                                        org.apache.http.config;version="[4.3.0,5.0.0)"
                                        org.apache.http.conn.params;version="[4.4.0,5.0.0)"
                                        org.apache.http.conn.scheme;version="[4.4.0,5.0.0)"
                                        org.apache.http.conn.socket;version="[4.4.0,5.0.0)"
                                        org.apache.http.conn.ssl;version="[4.4.0,5.0.0)"
                                        org.apache.http.conn.util;version="[4.4.0,5.0.0)"
                                        org.apache.http.conn;version="[4.4.0,5.0.0)"
                                        org.apache.http.entity;version="[4.3.0,5.0.0)"
                                        org.apache.http.impl.client;version="[4.4.0,5.0.0)"
                                        org.apache.http.impl.conn;version="[4.4.0,5.0.0)"
                                        org.apache.http.params;version="[4.3.0,5.0.0)"
                                        org.apache.http.ssl;version="[4.3.0,5.0.0)"
                                        org.apache.http;version="[4.3.0,5.0.0)"
                                        org.eclipse.jgit.annotations;version="[6.3.0,6.4.0)"
                                        org.eclipse.jgit.nls;version="[6.3.0,6.4.0)"
                                        org.eclipse.jgit.transport.http;version="[6.3.0,6.4.0)"
                                        org.eclipse.jgit.util;version="[6.3.0,6.4.0)"
Manifest-Version                        1.0

The manifest is clearly not importing this package. Looking at the analysis of the jar:

[USES]

org.eclipse.jgit.transport.http.apache  javax.net.ssl
                                        org.apache.http
                                        org.apache.http.client
                                        org.apache.http.client.config
                                        org.apache.http.client.methods
                                        org.apache.http.config
                                        org.apache.http.conn
                                        org.apache.http.conn.socket
                                        org.apache.http.conn.ssl
                                        org.apache.http.entity
                                        org.apache.http.impl.client
                                        org.apache.http.impl.conn
                                        org.apache.http.ssl
                                        org.eclipse.jgit.lib
                                        org.eclipse.jgit.transport.http
                                        org.eclipse.jgit.transport.http.apache.internal
                                        org.eclipse.jgit.util
org.eclipse.jgit.transport.http.apache.internal org.eclipse.jgit.nls


[USEDBY]

javax.net.ssl                           org.eclipse.jgit.transport.http.apache

So the code clearly references this package.

I am not sure how you generate the manifest here in this project, but looking at manifest I see:

Import-Package: org.apache.http;version="[4.3.0,5.0.0)",
 org.apache.http.client;version="[4.4.0,5.0.0)",
 org.apache.http.client.config;version="[4.4.0,5.0.0)",
 org.apache.http.client.methods;version="[4.4.0,5.0.0)",
 org.apache.http.client.params;version="[4.4.0,5.0.0)",
 org.apache.http.config;version="[4.3.0,5.0.0)",
 org.apache.http.conn;version="[4.4.0,5.0.0)",
 org.apache.http.conn.params;version="[4.4.0,5.0.0)",
 org.apache.http.conn.scheme;version="[4.4.0,5.0.0)",
 org.apache.http.conn.socket;version="[4.4.0,5.0.0)",
 org.apache.http.conn.ssl;version="[4.4.0,5.0.0)",
 org.apache.http.conn.util;version="[4.4.0,5.0.0)",
 org.apache.http.entity;version="[4.3.0,5.0.0)",
 org.apache.http.impl.client;version="[4.4.0,5.0.0)",
 org.apache.http.impl.conn;version="[4.4.0,5.0.0)",
 org.apache.http.params;version="[4.3.0,5.0.0)",
 org.apache.http.ssl;version="[4.3.0,5.0.0)",
 org.eclipse.jgit.annotations;version="[6.8.0,6.9.0)",
 org.eclipse.jgit.nls;version="[6.8.0,6.9.0)",
 org.eclipse.jgit.transport.http;version="[6.8.0,6.9.0)",
 org.eclipse.jgit.util;version="[6.8.0,6.9.0)"

Which clearly does not show javax.net.ssl?

I am really puzzled how this could've worked ever?

@msohn
Copy link
Member

msohn commented Dec 4, 2023

merged https://eclipse.gerrithub.io/c/eclipse-jgit/jgit/+/1173142

@msohn msohn closed this as completed Dec 4, 2023
eclipse-jgit-bot pushed a commit that referenced this issue Dec 9, 2023
RefDirectory:pack might raise an NPE when deleting loose
refs as final part of the RefDirectory.pack().

This is what the code does:
1) packed ref update: update the list of refs which will be
persisted in packed-refs
2) persit packed-refs: flush on file the refs computed in #1
3) prune loose refs: prune loose refs that have been packed in #2

The code correctly locks the packed-refs file during phases 1 to 3.
However, it makes the wrong assumption of considering
the loose refs set as immutable between phases 1 and 3.

The number and values of loose refs on the filesystem can mutate
at any time whilst the RefDirectory.pack() is in progress.
Assuming the contrary can lead to an NPE when retrieving refs
from the mutable loose refs list during phase #3.

Make sure that the ref is not null before dereferencing its
object-id value.

Bug: jgit-4
Change-Id: I2cd01f8a880f3c6561ad978a389ec2db45b6018b
@tomaswolf tomaswolf added this to the 6.9.0 milestone Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants