Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-projects-issues opened this issue Oct 30, 2009 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Oct 30, 2009

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

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good point. I've simply removed logging from RequestContextListener.

Juergen

@spring-projects-issues spring-projects-issues added type: bug A general bug in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 RC2 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants