# Elasticsearch org.apache.logging.log4j.core.impl.ThrowableProxy

**URL:** <https://discuss.elastic.co/t/elasticsearch-org-apache-logging-log4j-core-impl-throwableproxy/68268>\
**Category:** Elasticsearch\
**Created:** [December 7, 2016, 9:08am UTC](https://discuss.elastic.co/t/elasticsearch-org-apache-logging-log4j-core-impl-throwableproxy/68268 "2016-12-07T09:08:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://discuss.elastic.co/u/francois)\
**Post date:** [December 7, 2016, 9:08am UTC](https://discuss.elastic.co/t/elasticsearch-org-apache-logging-log4j-core-impl-throwableproxy/68268/1 "2016-12-07T09:08:13Z")

</div>

Hi,

I use Elastic 5.0.2 (via maven) in a web app (running on Tomcat 8.5).  
Also I use Log4J 2.7.

I use the java client  
new PreBuiltTransportClient(settings).addTransportAddress(inetSocketTransportAddress);

If the connection fail, I get this error  
java.lang.NoSuchMethodError: org.apache.logging.log4j.core.util.Loader.loadClass(Ljava/lang/String;)Ljava/lang/Class;  
at org.apache.logging.log4j.core.impl.ThrowableProxy.loadClass(ThrowableProxy.java:497)

The ThrowableProxy copy from Elastic is not the same as the one provided by Log4J 2.7

I also noticed taht in Elastic github repo ThrowableProxy is not present.  
Only in the maven distribution.

Is there a workaround ?  
Did I made a mistake ?

Thanks for your help  
Francois

---

<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:** [December 7, 2016, 9:23am UTC](https://discuss.elastic.co/t/elasticsearch-org-apache-logging-log4j-core-impl-throwableproxy/68268/2 "2016-12-07T09:23:11Z")

</div>

You need to use a previous version of log4j as explained at [https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/\_log4j\_2\_logger.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/_log4j_2_logger.html)

---

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://discuss.elastic.co/u/francois)\
**Post date:** [December 7, 2016, 9:29am UTC](https://discuss.elastic.co/t/elasticsearch-org-apache-logging-log4j-core-impl-throwableproxy/68268/3 "2016-12-07T09:29:15Z")

</div>

> [@dadoonet](#):
>
> You need to use a previous version of log4j as explained at

Thank for your response but I am not able to modify the version 2.7 of log4J, which is used in other products we use.

When do you think it will be fixed ?

---

<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:** [December 7, 2016, 9:40am UTC](https://discuss.elastic.co/t/elasticsearch-org-apache-logging-log4j-core-impl-throwableproxy/68268/4 "2016-12-07T09:40:42Z")

</div>

In 5.1 for sure: [https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.1/\_log4j\_2\_logger.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.1/_log4j_2_logger.html)

It will be released really soon I think.

---

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://discuss.elastic.co/u/francois)\
**Post date:** [December 7, 2016, 9:54am UTC](https://discuss.elastic.co/t/elasticsearch-org-apache-logging-log4j-core-impl-throwableproxy/68268/5 "2016-12-07T09:54:58Z")

</div>

super !

BTW, It's a very bad practice to maintain in Elastic source code a copy of the Log4J ThrowableProxy class.  
I know that some improvements have been done concerning the logging in Elastic.  
I hope ThrowableProxy will soon disappear !

Thank David.

---

<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:** [December 7, 2016, 2:51pm UTC](https://discuss.elastic.co/t/elasticsearch-org-apache-logging-log4j-core-impl-throwableproxy/68268/6 "2016-12-07T14:51:20Z")

</div>

Yes. It's gone when you upgrade to 2.7 (so in ES 5.1). Basically we had to workaround [https://issues.apache.org/jira/browse/LOG4J2-1560](https://issues.apache.org/jira/browse/LOG4J2-1560) in the meantime.

---

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://discuss.elastic.co/u/francois)\
**Post date:** [December 7, 2016, 3:39pm UTC](https://discuss.elastic.co/t/elasticsearch-org-apache-logging-log4j-core-impl-throwableproxy/68268/7 "2016-12-07T15:39:44Z")

</div>

Thanks David

---

<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:** [January 4, 2017, 3:39pm UTC](https://discuss.elastic.co/t/elasticsearch-org-apache-logging-log4j-core-impl-throwableproxy/68268/8 "2017-01-04T15:39:52Z")

</div>

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