Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16220

Documentation leads to NPE Missing SslContextFactory for SolrJ client

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 9.0
    • None
    • documentation, SolrJ

    Description

      Following the documentation here:
      https://solr.apache.org/guide/solr/latest/deployment-guide/solrj.html

       

      This code leads to an NPE:

      Http2SolrClient mavenCentralRepo = new Http2SolrClient.Builder("https://search.maven.org/solrsearch").build();
      
      final SolrQuery query = new SolrQuery("fc:" + className);
      query.setRows(20);
      
      QueryResponse response = mavenCentralRepo.query(query);

      NPE:

      java.lang.NullPointerException: Missing SslContextFactory
      	at java.base/java.util.Objects.requireNonNull(Objects.java:246)
      	at org.eclipse.jetty.io.ssl.SslClientConnectionFactory.<init>(SslClientConnectionFactory.java:57)
      	at org.eclipse.jetty.client.HttpClient.newSslClientConnectionFactory(HttpClient.java:1208)
      	at org.eclipse.jetty.client.HttpClient.newSslClientConnectionFactory(HttpClient.java:1214)
      	at org.eclipse.jetty.client.HttpDestination.newSslClientConnectionFactory(HttpDestination.java:148)
      	at org.eclipse.jetty.client.HttpDestination.newSslClientConnectionFactory(HttpDestination.java:154)
      	at org.eclipse.jetty.client.HttpDestination.<init>(HttpDestination.java:94)
      	at org.eclipse.jetty.client.MultiplexHttpDestination.<init>(MultiplexHttpDestination.java:25)
      	at org.eclipse.jetty.http2.client.http.HttpDestinationOverHTTP2.<init>(HttpDestinationOverHTTP2.java:32)
      	at org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2.newHttpDestination(HttpClientTransportOverHTTP2.java:128)
      	at org.eclipse.jetty.client.HttpClient.lambda$resolveDestination$0(HttpClient.java:575)
      	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
      	at org.eclipse.jetty.client.HttpClient.resolveDestination(HttpClient.java:573)
      	at org.eclipse.jetty.client.HttpClient.resolveDestination(HttpClient.java:551)
      	at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:599)
      	at org.eclipse.jetty.client.HttpRequest.sendAsync(HttpRequest.java:778)
      	at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:765)
      	at org.apache.solr.client.solrj.impl.Http2SolrClient.request(Http2SolrClient.java:448)
      	at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:217)
      	at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:927)
      	at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:940)

      I think there is a bug in Http2SolrClient somewhere. Such URLs should be supported out of the box on a Java 11 JDK without requiring users to provide system properties or other custom initialization. Otherwise it should be documented but I couldn't find anything related to TLS/SSL configuration in the doc mentioned above.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gunnar Gunnar Wagenknecht
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: