logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Calmus <m...@calmus.org>
Subject Unable to lookup java:comp/env/log4j/context-name
Date Thu, 10 Dec 2015 20:09:05 GMT
We are moving from Weblogic (10g) to JBoss (EAP6).

The server is set to use the JndiContextSelector. All the required
properties are set in the web.xml.

With apps that have EJBs or web services, JBoss seems to be initializing
the code as it is being deployed. Because our base web service classes have
Logger instances in them, these are also initialized during deployment.
This seems to happen, though independently of the reading of the
configuration paramters in the web.xml. As such, the log gets flooded with
messages similar to this:

ERROR Unable to lookup java:comp/env/log4j/context-name
javax.naming.NameNotFoundException: java:comp/env/log4j/context-name
       at
org.jboss.as.naming.InitialContext$DefaultInitialContext.findContext(InitialContext.java:197)
       at
org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:241)
       at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:183)
       at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)
       at javax.naming.InitialContext.lookup(InitialContext.java:417)
       at javax.naming.InitialContext.lookup(InitialContext.java:417)
       at
org.apache.logging.log4j.core.net.JndiManager.lookup(JndiManager.java:128)
       at
org.apache.logging.log4j.core.selector.JndiContextSelector.getContext(JndiContextSelector.java:113)

These message don't seem to be causing any actual problems with the
application or deployment, but it would be nice to not have them.

I've tried also adding the env-entry property to the ear's application.xml,
but that seems not to be any more helpful.

What can I do to eliminate these messages?

We are using Log4j 2.4.1 with Java 8.

Thank you.

--
Mike

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message