Hard to say without seeing your project but jetty seems to be using slf4j as of 
some time 
https://github.com/jetty/jetty.project/blob/7d264e6024efc80124592124891fb6e25b1554af/jetty-core/jetty-http2/jetty-http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java#L43
 so I'd first check if you can just solve this by upgrading.

This might help give some context to what happened to jetty's logging impl 
https://github.com/jetty/jetty.project/pull/4643

Keep in mind that spring boot can be opinionated about logging depending on 
which starter you use 
https://docs.spring.io/spring-boot/docs/2.0.x/reference/html/howto-logging.html#howto-logging
 .. If the version of Jetty you are running against is linking through an slf4j 
interface (as it has been for some time apparently) then you should be able to 
use a different/more modern logging implementation (i.e. Logback) and manage 
all of that just by adding the right dependency.

Luke

From: users@solr.apache.org At: 05/16/24 12:41:05 UTC-4:00To:  
users@solr.apache.org
Subject: Problems migrating solrj to run with SpringBoot 3

I'm in the process of upgrading a project that uses SolrJ to run with Spring 
Boot 3.  I've been able to keep the current version of my jars after migrating 
to SpringBoot 3.   SolrJ is working in some cases, but I've run into a problem 
where it is missing the logging class for Jetty.  I get this stack trace:


java.lang.ExceptionInInitializerError: Exception 
java.lang.NoClassDefFoundError: org/eclipse/jetty/util/log/Log [in thread 
"http-nio-8080-exec-8"]

       at 
org.eclipse.jetty.http2.hpack.HpackEncoder.<clinit>(HpackEncoder.java:48)

       at 
org.eclipse.jetty.http2.hpack.HpackFieldPreEncoder.getEncodedField(HpackFieldPre
Encoder.java:45)

       at 
org.eclipse.jetty.http.PreEncodedHttpField.<init>(PreEncodedHttpField.java
:79)

       at 
org.eclipse.jetty.http.PreEncodedHttpField.<init>(PreEncodedHttpField.java
:85)

       at 
org.eclipse.jetty.http.PreEncodedHttpField.<init>(PreEncodedHttpField.java
:90)

       at org.eclipse.jetty.http.HttpFields.<clinit>(HttpFields.java:48)

       at 
org.eclipse.jetty.client.transport.HttpRequest.<init>(HttpRequest.java:68)

       at 
org.eclipse.jetty.client.HttpClient.newHttpRequest(HttpClient.java:449)

       at org.eclipse.jetty.client.HttpClient.newRequest(HttpClient.java:439)

       at 
org.springframework.http.client.JettyClientHttpRequestFactory.createRequest(Jett
yClientHttpRequestFactory.java:135)

I've looked high and low to find this class.   I would hope that it would have 
been embedded in the SolrJ jar, but apparently not.  I'm using this version of 
Solrj:


              <dependency>

                  <groupId>org.apache.solr</groupId>

                  <artifactId>solr-solrj</artifactId>

                  <version>8.11.3</version>

              </dependency>

Along with

              <dependency>

                     <groupId>org.springframework.boot</groupId>

                     <artifactId>spring-boot-starter-data-solr</artifactId>

                     <version>2.4.7</version>

              </dependency>

That is part of SpringBoot.

As far as I can tell, the only difference in the build is the version of 
SpringBoot libraries.

Any Ideas?

Thank you so much for your help.

Todd Stevenson


NOTICE: This e-mail is for the sole use of the intended recipient and may 
contain confidential and privileged information. If you are not the intended 
recipient, you are prohibited from reviewing, using, disclosing or distributing 
this e-mail or its contents. If you have received this e-mail in error, please 
contact the sender by reply e-mail and destroy all copies of this e-mail and 
its contents.


Reply via email to