# Elasticsearch not working in Wildfly 10 after upgrading to 2.1.1

**URL:** <https://discuss.elastic.co/t/elasticsearch-not-working-in-wildfly-10-after-upgrading-to-2-1-1/39896>\
**Category:** Elasticsearch\
**Created:** [January 22, 2016, 3:26pm UTC](https://discuss.elastic.co/t/elasticsearch-not-working-in-wildfly-10-after-upgrading-to-2-1-1/39896 "2016-01-22T15:26:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![PhilippC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/philippc/32/7337_2.png) [@PhilippC](https://discuss.elastic.co/u/PhilippC)\
**Post date:** [January 22, 2016, 3:26pm UTC](https://discuss.elastic.co/t/elasticsearch-not-working-in-wildfly-10-after-upgrading-to-2-1-1/39896/1 "2016-01-22T15:26:04Z")

</div>

I am working on a Java EE 7 WebApplication (running in wildfly 10) using an embedded Elasticsearch. After upgrading to elasticsearch 2.1.1 searching is not working anymore. (indexing seems to work)

Dependencies that worked:

```
<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>2.0.2</version>
</dependency>
<dependency>
    <groupId>org.apache.lucene</groupId>
    <artifactId>lucene-core</artifactId>
    <version>5.2.1</version>
</dependency>

```

Upgraded dependencies:

```
<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>2.1.1</version>
</dependency>
<dependency>
    <groupId>org.apache.lucene</groupId>
    <artifactId>lucene-core</artifactId>
    <version>5.3.1</version>
</dependency>

```

After indexing a very basic document (indexing seems to work), searching fails with the following exception:

> org.elasticsearch.action.search.SearchPhaseExecutionException : all shards failed [Proxied because : Original exception caused: class java.io.NotSerializableException: org.elasticsearch.action.search.ShardSearchFailure]  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:228)  
> at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$1.onFailure(TransportSearchTypeAction.java:174)  
> at org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:46)  
> at org.elasticsearch.transport.local.LocalTransport.handleException(LocalTransport.java:354)  
> at org.elasticsearch.transport.local.LocalTransport.handlerResponseError(LocalTransport.java:345)  
> at org.elasticsearch.transport.local.LocalTransport.messageReceived(LocalTransport.java:241)  
> at org.elasticsearch.transport.local.LocalTransportChannel$2.run(LocalTransportChannel.java:99)  
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
> at java.lang.Thread.run(Thread.java:745)  
> Caused by: org.elasticsearch.common.io.stream.NotSerializableExceptionWrapper: \_byteSymbolCanonicalizer  
> at com.fasterxml.jackson.dataformat.smile.SmileFactory.\_createParser(SmileFactory.java:404)  
> at com.fasterxml.jackson.dataformat.smile.SmileFactory.createParser(SmileFactory.java:327)  
> at org.elasticsearch.common.xcontent.smile.SmileXContent.createParser(SmileXContent.java:107)  
> at org.elasticsearch.common.xcontent.smile.SmileXContent.createParser(SmileXContent.java:113)  
> at org.elasticsearch.search.SearchService.parseSource(SearchService.java:817)  
> at org.elasticsearch.search.SearchService.createContext(SearchService.java:651)  
> at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:617)  
> at org.elasticsearch.search.SearchService.executeDfsPhase(SearchService.java:262)  
> at org.elasticsearch.search.action.SearchServiceTransportAction$SearchDfsTransportHandler.messageReceived(SearchServiceTransportAction.java:360)  
> at org.elasticsearch.search.action.SearchServiceTransportAction$SearchDfsTransportHandler.messageReceived(SearchServiceTransportAction.java:357)  
> at org.elasticsearch.transport.local.LocalTransport$2.doRun(LocalTransport.java:280)  
> at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)  
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
> at java.lang.Thread.run(Thread.java:745)

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 22, 2016, 4:46pm UTC](https://discuss.elastic.co/t/elasticsearch-not-working-in-wildfly-10-after-upgrading-to-2-1-1/39896/2 "2016-01-22T16:46:12Z")

</div>

Check your runtime classpath. You need Jackson 2.6.2, it seems you have older versions.

---

<div class="post-metadata">

**Author:** ![PhilippC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/philippc/32/7337_2.png) [@PhilippC](https://discuss.elastic.co/u/PhilippC)\
**Post date:** [January 22, 2016, 6:24pm UTC](https://discuss.elastic.co/t/elasticsearch-not-working-in-wildfly-10-after-upgrading-to-2-1-1/39896/3 "2016-01-22T18:24:31Z")

</div>

Thanks for your answer!

I have jackson 2.6.2 in my classpath. (core, databind and dataformat-\*)

Could it be that some of jboss-resteasy libraries are interfering?  
I have them in provided scope as i am running in wildfly 10.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 22, 2016, 7:04pm UTC](https://discuss.elastic.co/t/elasticsearch-not-working-in-wildfly-10-after-upgrading-to-2-1-1/39896/4 "2016-01-22T19:04:24Z")

</div>

May be this can help?

> **[To shade or not to shade](https://www.elastic.co/blog/to-shade-or-not-to-shade)**
>
> Before version 2.0, Elasticsearch was provided as a JAR with some (but not all) common dependencies shaded and packaged within the same artifact. This helped Java users who embed Elasticsearch in thei...

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 22, 2016, 8:31pm UTC](https://discuss.elastic.co/t/elasticsearch-not-working-in-wildfly-10-after-upgrading-to-2-1-1/39896/5 "2016-01-22T20:31:37Z")

</div>

I think you are on Wildfly 10 CR5. Provided scope does not make a difference, and although RESTeasy is a PITA, Jackson is a core Wildfly module. Check `$WILDFLY_HOME/modules/system/layers/base/`, from there you can see that WF is using Jackson 2.5.4 and not 2.6.2. So it can't be possible that you have 2.6.2. in your WF runtime classpath (except those jars in your ES web app)

I would try to update Jackson 2.5.5 with 2.6.2 jars in WF. If that is not possible, you must build ES jar with shaded dependencies, as @dadoonet suggested.

---

<div class="post-metadata">

**Author:** ![PhilippC](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/philippc/32/7337_2.png) [@PhilippC](https://discuss.elastic.co/u/PhilippC)\
**Post date:** [January 25, 2016, 8:22am UTC](https://discuss.elastic.co/t/elasticsearch-not-working-in-wildfly-10-after-upgrading-to-2-1-1/39896/6 "2016-01-25T08:22:12Z")

</div>

I think you're right. Thanks for clearing that up.  
Could it be possible to somehow exclude wildfly jackson via a "jboss-deployment-structure.xml" and have my app include its required library?

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 25, 2016, 8:40am UTC](https://discuss.elastic.co/t/elasticsearch-not-working-in-wildfly-10-after-upgrading-to-2-1-1/39896/7 "2016-01-25T08:40:36Z")

</div>

This is not the 100% WIildfly forum, but as far as I can judge, for RESTeasy, you could try something like

```auto
<jboss-deployment-structure>
    <deployment>
        <exclusions>
           <module name="org.jboss.resteasy.resteasy-jackson2-provider"/>
        </exclusions>
    </deployment>
</jboss-deployment-structure> 

```

and then removing the Jackson jars from `$WILDFLY_HOME/modules/system/layers/base/`. Note that this removes all Jackson functionality from Wildfly unless you supply the jars again.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:22pm UTC](https://discuss.elastic.co/t/elasticsearch-not-working-in-wildfly-10-after-upgrading-to-2-1-1/39896/8 "2017-07-05T23:22:00Z")

</div>


