You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Yvan Zo <yv...@metabrainz.org> on 2024/03/07 13:00:00 UTC

HK2 service reification failed starting from Solr 9.5.0

Hi Solr users,

I’m trying to upgrade from Solr 9.4.0 to 9.5.0, and I’m now getting the
following WARN message in logs when starting the server.

WARN  (main) [c: s: r: x: t:] o.g.j.i.Errors The following warnings
have been detected: WARNING: HK2 service reification failed for
[org.glassfish.jersey.message.internal.DataSourceProvider] with an
exception:
> MultiException stack 1 of 2
> java.lang.NoClassDefFoundError: jakarta/activation/DataSource
> 	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
> 	at java.base/java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
> 	at java.base/java.lang.Class.getDeclaredConstructors(Unknown Source)
> 	at org.jvnet.hk2.internal.Utilities$3.run(Utilities.java:1355)
> 	at org.jvnet.hk2.internal.Utilities$3.run(Utilities.java:1351)
> 	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
> 	at org.jvnet.hk2.internal.Utilities.getAllConstructors(Utilities.java:1351)
> 	at org.jvnet.hk2.internal.Utilities.findProducerConstructor(Utilities.java:1294)
> 	at org.jvnet.hk2.internal.DefaultClassAnalyzer.getConstructor(DefaultClassAnalyzer.java:60)
> 	at org.glassfish.jersey.inject.hk2.JerseyClassAnalyzer.getConstructor(JerseyClassAnalyzer.java:124)
> 	at org.jvnet.hk2.internal.Utilities.getConstructor(Utilities.java:157)
> 	at org.jvnet.hk2.internal.ClazzCreator.initialize(ClazzCreator.java:106)
> 	at org.jvnet.hk2.internal.ClazzCreator.initialize(ClazzCreator.java:165)
> 	at org.jvnet.hk2.internal.SystemDescriptor.internalReify(SystemDescriptor.java:719)
> 	at org.jvnet.hk2.internal.SystemDescriptor.reify(SystemDescriptor.java:673)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:438)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2316)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl$10.compute(ServiceLocatorImpl.java:1401)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl$10.compute(ServiceLocatorImpl.java:1396)
> 	at org.glassfish.hk2.utilities.cache.internal.WeakCARCacheImpl.compute(WeakCARCacheImpl.java:105)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetAllServiceHandles(ServiceLocatorImpl.java:1458)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServiceHandles(ServiceLocatorImpl.java:1384)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServiceHandles(ServiceLocatorImpl.java:1372)
> 	at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.getAllServiceHolders(AbstractHk2InjectionManager.java:134)
> 	at org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager.getAllServiceHolders(ImmediateHk2InjectionManager.java:30)
> 	at org.glassfish.jersey.internal.inject.Providers.getServiceHolders(Providers.java:308)
> 	at org.glassfish.jersey.internal.inject.Providers.getCustomProviders(Providers.java:152)
> 	at org.glassfish.jersey.message.internal.MessageBodyFactory.initialize(MessageBodyFactory.java:219)
> 	at org.glassfish.jersey.message.internal.MessageBodyFactory$MessageBodyWorkersConfigurator.postInit(MessageBodyFactory.java:114)
> 	at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$2(ApplicationHandler.java:366)
> 	at java.base/java.util.Arrays$ArrayList.forEach(Unknown Source)
> 	at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:366)
> 	at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$1(ApplicationHandler.java:310)
> 	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
> 	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
> 	at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:232)
> 	at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:309)
> 	at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:274)
> 	at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:249)
> 	at org.apache.solr.core.CoreContainer.loadInternal(CoreContainer.java:1154)
> 	at org.apache.solr.core.CoreContainer.load(CoreContainer.java:762)
> 	at org.apache.solr.servlet.CoreContainerProvider.createCoreContainer(CoreContainerProvider.java:427)
> 	at org.apache.solr.servlet.CoreContainerProvider.init(CoreContainerProvider.java:246)
> 	at org.apache.solr.servlet.CoreContainerProvider.contextInitialized(CoreContainerProvider.java:116)
> 	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:1049)
> 	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:624)
> 	at org.eclipse.jetty.server.handler.ContextHandler.contextInitialized(ContextHandler.java:984)
> 	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:740)
> 	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:392)
> 	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1304)
> 	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:901)
> 	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:306)
> 	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:532)
> 	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
> 	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
> 	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:121)
> 	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
> 	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
> 	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
> 	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
> 	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
> 	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
> 	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
> 	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:121)
> 	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
> 	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
> 	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
> 	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
> 	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
> 	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
> 	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
> 	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
> 	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
> 	at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:221)
> 	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
> 	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
> 	at org.eclipse.jetty.server.Server.start(Server.java:470)
> 	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
> 	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
> 	at org.eclipse.jetty.server.Server.doStart(Server.java:415)
> 	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
> 	at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1919)
> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
> 	at org.eclipse.jetty.start.Main.invokeMain(Main.java:229)
> 	at org.eclipse.jetty.start.Main.start(Main.java:528)
> 	at org.eclipse.jetty.start.Main.main(Main.java:76)
> Caused by: java.lang.ClassNotFoundException: jakarta.activation.DataSource
> 	at java.base/java.net.URLClassLoader.findClass(Unknown Source)
> 	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
> 	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
> 	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:460)
> 	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
> 	... 89 more
> 	Suppressed: java.lang.ClassNotFoundException: jakarta.activation.DataSource
> 		at java.base/java.net.URLClassLoader.findClass(Unknown Source)
> 		at org.eclipse.jetty.webapp.WebAppClassLoader.findClass(WebAppClassLoader.java:581)
> 		at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:484)
> 		... 90 more
> MultiException stack 2 of 2
> java.lang.IllegalArgumentException: Errors were discovered while reifying SystemDescriptor(
> 	implementation=org.glassfish.jersey.message.internal.DataSourceProvider
> 	contracts={jakarta.ws.rs.ext.MessageBodyReader,jakarta.ws.rs.ext.MessageBodyWriter}
> 	scope=jakarta.inject.Singleton
> 	qualifiers={}
> 	descriptorType=CLASS
> 	descriptorVisibility=NORMAL
> 	metadata=
> 	rank=0
> 	loader=null
> 	proxiable=null
> 	proxyForSameScope=null
> 	analysisName=null
> 	id=94
> 	locatorId=0
> 	identityHashCode=1521891844
> 	reified=false)
> 	at org.jvnet.hk2.internal.SystemDescriptor.reify(SystemDescriptor.java:684)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:438)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2316)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl$10.compute(ServiceLocatorImpl.java:1401)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl$10.compute(ServiceLocatorImpl.java:1396)
> 	at org.glassfish.hk2.utilities.cache.internal.WeakCARCacheImpl.compute(WeakCARCacheImpl.java:105)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetAllServiceHandles(ServiceLocatorImpl.java:1458)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServiceHandles(ServiceLocatorImpl.java:1384)
> 	at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServiceHandles(ServiceLocatorImpl.java:1372)
> 	at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.getAllServiceHolders(AbstractHk2InjectionManager.java:134)
> 	at org.glassfish.jersey.inject.hk2.ImmediateHk2Inje...
>
>
I use a custom XML response writer that imports classes from both `
jakarta.xml.bind` and `javax.xml.datatype`. It is built through Maven and
the resulting JAR is put under `/opt/solr/lib/` in a Docker image based on
the official Docker image `solr:9.5.0-slim` that embeds Temurin 17.

It seems that this change of behavior might be related to the resolution of
https://issues.apache.org/jira/browse/SOLR-17089 in Solr 9.5.0 but I’m not
sure about it.

Am I doing something wrong? Can I safely ignore this warning? Should I
report it?

Thanks in advance for your time,
Yvan

Re: HK2 service reification failed starting from Solr 9.5.0

Posted by Yvan Zo <yv...@metabrainz.org>.
On Fri, Mar 8, 2024 at 9:43 AM Shawn Heisey <ap...@elyograg.org.invalid>
wrote:

> Chances are that your code is not compatible with the libraries that
> were upgraded in version 9.5.  You probably need to compile it against
> the upgraded libraries, and I have no way of knowing if code changes are
> going to be required for that to work, but I would not be surprised if
> they are.
>
> It is always a good idea to recompile custom jars when upgrading Solr to
> ensure that they are referencing correct library versions.
>

Thank you Shawn but I already recompiled this JAR, with an updated POM
matching Solr 9.5.0 dependencies.
Despite this warning the server is actually working, even when required to
use this custom response writer.

Re: HK2 service reification failed starting from Solr 9.5.0

Posted by Shawn Heisey <ap...@elyograg.org.INVALID>.
zOn 3/7/24 06:00, Yvan Zo wrote:
> I’m trying to upgrade from Solr 9.4.0 to 9.5.0, and I’m now getting the
> following WARN message in logs when starting the server.

<snip>

> I use a custom XML response writer that imports classes from both `
> jakarta.xml.bind` and `javax.xml.datatype`. It is built through Maven and
> the resulting JAR is put under `/opt/solr/lib/` in a Docker image based on
> the official Docker image `solr:9.5.0-slim` that embeds Temurin 17.
> 
> It seems that this change of behavior might be related to the resolution of
> https://issues.apache.org/jira/browse/SOLR-17089 in Solr 9.5.0 but I’m not
> sure about it.

Chances are that your code is not compatible with the libraries that 
were upgraded in version 9.5.  You probably need to compile it against 
the upgraded libraries, and I have no way of knowing if code changes are 
going to be required for that to work, but I would not be surprised if 
they are.

It is always a good idea to recompile custom jars when upgrading Solr to 
ensure that they are referencing correct library versions.

Thanks,
Shawn