Expand my Community achievements bar.

Solr Missing SslContextFactory AEM with HTTP2Client

Avatar

Level 1

<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<scope>provided</scope>
<version>9.1.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<scope>provided</scope>
<version>9.4.19.v20190610</version>
</dependency>
<!-- Needed for the SSLContextFactory$Client class -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<scope>provided</scope>
<version>9.4.19.v20190610</version>
</dependency>

String urlString = "https://connecttosolr.com/solr/mycollection";
Http2SolrClient solr = new Http2SolrClient.Builder(urlString).build();
solr.setParser(new XMLResponseParser());


SolrInputDocument doc = createPageSolrDoc(indexPageData);
try{
solr.add(doc);
}
catch(Exception e){
logger.info("******* error in add :********" + e.toString());
}

solr.commit();

I am getting below exception
indexto Solr Stacktrace [java.base/java.util.Objects.requireNonNull(Objects.java:246), org.eclipse.jetty.io.ssl.SslClientConnectionFactory.<init>(SslClientConnectionFactory.java:57), org.eclipse.jetty.client.HttpClient.newSslClientConnectionFactory(HttpClient.java:1208), org.eclipse.jetty.client.HttpClient.newSslClientConnectionFactory(HttpClient.java:1214), org.eclipse.jetty.client.HttpDestination.newSslClientConnectionFactory(HttpDestination.java:148), org.eclipse.jetty.client.HttpDestination.newSslClientConnectionFactory(HttpDestination.java:154), org.eclipse.jetty.client.HttpDestination.<init>(HttpDestination.java:94), org.eclipse.jetty.client.MultiplexHttpDestination.<init>(MultiplexHttpDestination.java:25), org.eclipse.jetty.http2.client.http.HttpDestinationOverHTTP2.<init>(HttpDestinationOverHTTP2.java:32), org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2.newHttpDestination(HttpClientTransportOverHTTP2.java:128), org.eclipse.jetty.client.HttpClient.lambda$resolveDestination$0(HttpClient.java:575), java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705), org.eclipse.jetty.client.HttpClient.resolveDestination(HttpClient.java:573), org.eclipse.jetty.client.HttpClient.resolveDestination(HttpClient.java:551), org.eclipse.jetty.client.HttpClient.send(HttpClient.java:599), org.eclipse.jetty.client.HttpRequest.sendAsync(HttpRequest.java:778), org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:765), org.apache.solr.client.solrj.impl.Http2SolrClient.request(Http2SolrClient.java:455), org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:234), org.apache.solr.client.solrj.SolrClient.commit(SolrClient.java:466), org.apache.solr.client.solrj.SolrClient.commit(SolrClient.java:442), com.caltex.b2c.core.model.search.solr.services.impl.SolrServiceImpl.indexPageToSolr(SolrServiceImpl.java:440), com.caltex.b2c.core.model.search.solr.services.impl.SolrServiceImpl.index(SolrServiceImpl.java:204), com.caltex.b2c.core.model.search.solr.services.impl.SolrServiceImpl.updateSolrIndex(SolrServiceImpl.java:113), com.caltex.b2c.core.model.search.solr.eventhandler.SolrEventHandler.handleEvent(SolrEventHandler.java:54), org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415), org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutBlacklistTiming(HandlerTask.java:82), org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:104), org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:166), java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515), java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264), java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128), java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628), java.base/java.lang.Thread.run(Thread.java:834)]

Error indexing /content/myproject/hk/en/b2c-master2/test-generic-batch2 to Solr Missing SslContextFactory
Kindly please suggest

 

1 Reply

Avatar

Community Advisor

Hi @meghaarrora 

 

Did you add the dependency in both core pom and main pom? Are you able to see the dependency being downloaded into your .m2 folder? Check if the bundle is available in AEM as well after the build is done.

 

Thanks,

Kiran Vedantam.