NoClassDefFoundError InternalLoggerFactory on tomcat start

(Anjana Surendrababu) #1

My project was using a very old version of elasticsearch (1.7.1). I am trying to upgrade it to 6.4.0

Following are the jars I added newly.

During my tomcat start I am getting this exception

java.lang.NoClassDefFoundError: io/netty/util/internal/logging/InternalLoggerFactory
at org.elasticsearch.transport.Netty4Plugin.(
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.elasticsearch.plugins.PluginsService.loadPlugin(
at org.elasticsearch.plugins.PluginsService.(
at org.elasticsearch.client.transport.TransportClient.newPluginService(
at org.elasticsearch.client.transport.TransportClient.buildTemplate(
at org.elasticsearch.client.transport.TransportClient.(
at org.elasticsearch.transport.client.PreBuiltTransportClient.(
at org.elasticsearch.transport.client.PreBuiltTransportClient.(
at org.elasticsearch.transport.client.PreBuiltTransportClient.(
at com.virima.indexing.IndexUtils.initializeESConnection(

And my initilization code is as below

Settings settings = Settings.builder()
.put("", "myClusterName").build();
TransportClient client = new PreBuiltTransportClient(settings)
.addTransportAddress(new TransportAddress(InetAddress.getByName("host1"), 9300))
.addTransportAddress(new TransportAddress(InetAddress.getByName("host2"), 9300));

(Mark Harwood) #2


(Anjana Surendrababu) #3

I went through the blog, I am sorry but I dint understand how it helps me in this

(Mark Harwood) #5

Apologies, I assumed you were trying to start a full elasticsearch service inside Tomcat rather than just the elasticsearch client.

We are evolving Java clients away from use of the TransportClient so that we can reduce these sorts of dependencies on core elasticsearch server classes.
The High Level Rest Client is the new replacement for the TransportClient and the docs for managing dependencies are here.

(Anjana Surendrababu) #6

Thanks for the response. So you are suggesting me using REST Client will be better than debugging this with TransportClient?

(Mark Harwood) #7

It will put you on the right path. Transport client will be deprecated in 7.0

(Anjana Surendrababu) #8

I am using high level rest client now, I have lucene 7.1 in my classpath, but I am getting the following error

Exception in thread "main" java.lang.NoSuchFieldError: LUCENE_6_0_0
at org.elasticsearch.Version.(
at org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper.(
at org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper.(
at org.elasticsearch.common.bytes.BytesReference.streamInput(
at org.elasticsearch.action.admin.indices.create.CreateIndexRequest.innerToXContent(
at org.elasticsearch.action.admin.indices.create.CreateIndexRequest.toXContent(

(Mark Harwood) #9

Looks like your Lucene version is incorrect.

(Anjana Surendrababu) #10

Dependecy file says Lucene-core 7.4.0, that only I added

(Mark Harwood) #11

If your classpath is setup correctly and you don't have other Lucene versions floating around then the above error should not happen because you should see this

(Anjana Surendrababu) #12

Hi, that issue seems to be fine, Any help on this How to add multiple types to an index Elasticsearch 6.4

(system) #13

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.