Hello,
I'm trying to create a EAR application that talks to ElasticSearch. But I can't get it to work. It keeps complaining about classes not being able to load.
I know Glassfish has it's own implementations of Jackson, so I tried to use the libraries attribute while deploying the app. Doesn't solve it 100%. Now I have a "dependencies" project which has jackson and ElasticSearch as dependencies, and I use the maven shade plugin like explained on the documentation. When I place that jar in the /domain/lib folder and try to run the application, I still get the following exception:
Caused by: java.lang.NoSuchFieldError: FAIL_ON_SYMBOL_HASH_OVERFLOW
at org.elasticsearch.common.xcontent.smile.SmileXContent.(SmileXContent.java:46)
at org.elasticsearch.common.xcontent.XContentFactory.contentBuilder(XContentFactory.java:124)
at org.elasticsearch.action.support.ToXContentToBytes.buildAsBytes(ToXContentToBytes.java:62)
at org.elasticsearch.action.search.SearchRequest.source(SearchRequest.java:250)
at org.elasticsearch.action.search.SearchRequestBuilder.beforeExecute(SearchRequestBuilder.java:1027)
at org.elasticsearch.action.search.SearchRequestBuilder.beforeExecute(SearchRequestBuilder.java:50)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)
at com.example.ESMessagesSessionBean.getMessages(ESMessagesSessionBean.java:23)
These are the libraries I include in the "dependencies" project
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-cbor</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-smile</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>2.2.1</version>
<scope>compile</scope>
</dependency>
</dependencies>`
Any idea on how to fix this issue? I ran out of ideas.
Erates