Skip to content

RequestContextListener initializes Log4J ahead of call to Log4jConfigListener [SPR-6288] #10955

@spring-projects-issues

Description

@spring-projects-issues

Martin Buch opened SPR-6288 and commented

This bug is related to #10645 which I believe is not solved at all (neither in 3.0 nor in 2.5.x).

In web.xml I have Log4jConfigListener declared ahead of RequestContextListener, but the application server container is instantiating RequestContextListener before Log4jConfigListener's requestInitialized is called. This causes Log4J Logger member variable of RequestContextListener initialized:
RequestContextListener
protected final Log logger = LogFactory.getLog(getClass());

The problem seems like the reporter of #10645 describes:
At least in Tomcat 6, the listeners all appear to be instantiated, then the contextInitialized(...)
method is called on them in the order declared in the web.xml.

It appears that the same happens with Oracle OC4J and maybe Weblogic and other AppServers.

The only solution for me to overcome the problem is to complety define my own copy of RequestContextListener without logger member.


Affects: 2.5.5, 2.5.6, 3.0 RC1

Referenced from: commits f595b67

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions