# Liferay tomcat application issues

**URL:** <https://discuss.elastic.co/t/liferay-tomcat-application-issues/244375>\
**Category:** APM\
**Tags:** java\
**Created:** [August 10, 2020, 9:21am UTC](https://discuss.elastic.co/t/liferay-tomcat-application-issues/244375 "2020-08-10T09:21:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsec](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@jsec](https://discuss.elastic.co/u/jsec)\
**Post date:** [August 10, 2020, 9:21am UTC](https://discuss.elastic.co/t/liferay-tomcat-application-issues/244375/1 "2020-08-10T09:21:35Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

TIP 1: select at least one tag that further categorizes your topic. For example `server` for APM Server related questions, `java` for questions regarding the Elastic APM Java agent, or `ui` for questions about the APM App within Kibana.

TIP 2: Check out the [troubleshooting guide](https://www.elastic.co/guide/en/apm/get-started/current/troubleshooting.html) first. Not only will it help you to resolve common problems faster but it also explains in more detail which information we need before we can properly help you.

**Kibana version** : 7.1.1

**Elasticsearch version** : 7.1.1

**APM Server version** : 7.1.1

**APM Agent language and version** : elastic-apm-agent-1.18.0.RC1.jar

**Browser version** : Chrome Version 84.0

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: downloaded the rpm files and installed them manually. started the components as services.

**Fresh install or upgraded from other version?** : fresh install

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

**Steps to reproduce** :

1. Start the application with elastic apm agent parameters
2. Check logs
3. Observe catalina.out output

**Errors in browser console (if relevant)**: no

**Provide logs and/or server output (if relevant)**:

Starting the liferay application (runs in tomcat) without the agent outputs not errors inside catalina.out

However, starting the application with the elastic apm agent outputs some errors.

This is my [setenv.sh](https://github.com/jsecro/logs/blob/master/setenv.sh) file  
Logs [without the agent started](https://github.com/jsecro/logs/blob/master/catalina_without_agent.out)  
Logs [with the agent started](https://github.com/jsecro/logs/blob/master/catalina_with_agent.out)

The application is starting eventually, even the GET/POST requests are visible in Kibana-\>APM, however, I would very much like to solve the errors.

Can you help me guys?

Many thanks,  
Catalin

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [August 10, 2020, 12:42pm UTC](https://discuss.elastic.co/t/liferay-tomcat-application-issues/244375/2 "2020-08-10T12:42:35Z")

</div>

Hi and welcome to the forum! 👋

Thanks for reporting this issue. We have lately been dealing with issues related to the initialization of our logging, which relies on log4j.

This specific case seems to be a bug in the Tomcat's implementation for JUL - according to the stack trace you provided, the construction of an `org.apache.juli.AsyncFileHandler` instance causes the invocation of a static method of `LocaleProviderAdapter`, even though this happens during the `LocaleProviderAdapter` class's static initialization, which means a static method is invoked on a non-initialized class.

Nevertheless, it seems that we can avoid a lot of these problems by delaying our logging initialization. This is easier said (or written) than done, as we will need to distinguish logging of events before and after the initialization, so this is something we will have to look into.

Currently, as long as there are no other side effects, please continue using the Java agent and just ignore these errors until we decide how we deal with them. If you DO encounter side effects, please let us know.

---

<div class="post-metadata">

**Author:** ![jsec](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@jsec](https://discuss.elastic.co/u/jsec)\
**Post date:** [August 10, 2020, 1:09pm UTC](https://discuss.elastic.co/t/liferay-tomcat-application-issues/244375/3 "2020-08-10T13:09:12Z")

</div>

Hi Eyal\_Koren,

Thanks for the information provided.  
I will keep you updated if something else appears.  
So, most probably these errors will go away in a future release of the APM Agent, right?

Many thanks,  
Catalin

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [August 10, 2020, 1:13pm UTC](https://discuss.elastic.co/t/liferay-tomcat-application-issues/244375/4 "2020-08-10T13:13:17Z")

</div>

> [@jsec](#):
>
> So, most probably these errors will go away in a future release of the APM Agent, right?

I believe so, but I can't guarantee when. I will have a closer look when I get the chance.

It may already behave a bit differently in you use the [latest snapshot](https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=co.elastic.apm&a=elastic-apm-agent&v=LATEST) from master, as we already applied some changes in this area.

---

<div class="post-metadata">

**Author:** ![jsec](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@jsec](https://discuss.elastic.co/u/jsec)\
**Post date:** [August 10, 2020, 1:15pm UTC](https://discuss.elastic.co/t/liferay-tomcat-application-issues/244375/5 "2020-08-10T13:15:40Z")

</div>

All right.  
I will try it and come back with feedback.

Thanks!

---

<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:** [August 31, 2020, 9:15am UTC](https://discuss.elastic.co/t/liferay-tomcat-application-issues/244375/6 "2020-08-31T09:15:50Z")

</div>

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