On 5/16/24 10:40, Todd Stevenson wrote:
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:
The problem you're running into is that Spring Boot 3 includes a MUCH
newer version of Jetty than SolrJ uses for its http client. They are on
Jetty 12.x and SolrJ is only using Jetty 10. So much has changed in two
major releases that SolrJ does not work with Jetty 12.
I tried adding the spring data solr starter and that didn't work either
-- it includes an 8.x version of SolrJ and jetty components from version
9. So Spring's own Solr abstraction layer doesn't work either with
Spring Boot 3.
With Spring Boot 2.7.18, I can get SolrJ working with the following
dependency list in build.gradle":
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation group: 'org.apache.solr', name: 'solr-solrj', version:
'9+'
implementation group: 'org.eclipse.jetty.http2', name: 'http2-client',
version: '10+'
implementation group: 'org.eclipse.jetty.http2', name: 'http2-common',
version: '10+'
implementation group: 'org.eclipse.jetty.http2', name: 'http2-hpack',
version: '10+'
implementation group: 'org.eclipse.jetty.http2', name:
'http2-http-client-transport', version: '10+'
implementation group: 'org.eclipse.jetty', name: 'jetty-util', version:
'10+'
implementation group: 'org.eclipse.jetty', name: 'jetty-io', version:
'10+'
implementation group: 'org.eclipse.jetty', name: 'jetty-http', version:
'10+'
implementation group: 'org.eclipse.jetty', name: 'jetty-client',
version: '10+'
implementation group: 'org.eclipse.jetty', name: 'jetty-alpn-client',
version: '10+'
implementation group: 'org.eclipse.jetty', name:
'jetty-alpn-java-client', version: '10+'
}
I don't know if using vanilla SolrJ is even going to be possible in
Spring Boot 3 until Solr gets upgraded to Jetty 12. That is a question
you should ask Spring.
Thanks,
Shawn