Tomcat – Deployment Freezes

I decided to write about this issue since it happen already twice to me.

Situation:
Suddenly your Tomcat freezes on deployment. After deleting the content of your weppapp directory and restarting tomcat, it freezes again, but probably on a different place. I spend a some time to find the issue.

Solution:
I configured some months ago a Log4j SocketAppender (in this case for logstash). But logstash hat some issues after an Elasticsearch upgrade.
log4j.properties
log4j.appender.=org.apache.log4j.net.SocketAppender
log4j.appender..port=9922
log4j.appender..remoteHost=localhost

After disabling the log4j SocketAppender the application was deploying without problems. Fortunately it was just a test setup, but I reminded me to be very careful about this dependency if it should be used on a production system.