-
Bug
-
Resolution: Done
-
Critical
-
8.2.1.Final, 9.0.0.Final
-
None
The Hibernate Search engine detects if the elasticsearch backend is on the classpath,
and if so, adds o.h.s.backend.elasticsearch.impl.ElasticsearchBridgeProvider to the top of the list of the annotation based bridge providers.
When processing an entity with a @DateBridge annotation, it picks the elasticsearch provider to converted from/to Date objects (since it has priority) which in turn fails with the exception:
org.infinispan.commons.CacheException: java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93) at org.hibernate.search.backend.elasticsearch.impl.ElasticsearchBridgeProvider$EsDateBridge.convertToString(ElasticsearchBridgeProvider.java:71) at org.hibernate.search.backend.elasticsearch.impl.ElasticsearchBridgeProvider$EsDateBridge.set(ElasticsearchBridgeProvider.java:54) at org.hibernate.search.bridge.util.impl.ContextualExceptionBridgeHelper$OneWayConversionContextImpl.set(ContextualExceptionBridgeHelper.java:110) at org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.buildDocumentFieldsForProperties(DocumentBuilderIndexedEntity.java:626)
This exception happens only when using the infinispan modules, where the elasticsearch backend is added as a dependency; in embedded mode the aforementioned provider is not loaded since the elasticsearch is not on the classpath.
This current behaviour is not the best for two reasons:
- When using Wildlfy modules, the elasticsearch backend is marked as optional, but still, it's visible in the classpath and gets loaded
- If the user is not using the elasticsearch backend, but the jar is on the classpath, elasticsearch date conversion will take precedence over the built-in bridge providers, and it shouldn't
- causes
-
JDG-196 org.hibernate.search.backend-elasticsearch eap module throws java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
- Closed
- is blocked by
-
HSEARCH-2067 Loading...
-
HSEARCH-2234 Loading...