ERROR in ch.qos.logback.classic.joran.action.InsertFromJNDIAction - Failed to lookup JNDI env-entry [java:global/stibam] javax.naming.NamingException: CWNEN1000E: A JNDI operation for a java:comp/env- Names cannot be executed because the current thread is not associated with a Java EE (Java Enterprise Edition) application component. This condition can occur when the JNDI client using the java:comp/env name is not in the thread of a server application request. Ensure that a Java EE application does not perform JNDI operations on java:comp/env names in static code blocks or in threads created by that application. Such code is not necessarily executed in a server application request thread and is therefore not supported by JNDI operations on java:comp/env names.
Hello Hendrik,
The new JNDI naming restriction is intended to prevent malicious JNDI
attacks in configuration files.
Do you know which Jakarta/EE/JavaEE specification WebSphere Liberty 21
implements? I would suggest reading section "Application Component
Environment Namespace" in the relevant document.
You might try to use one of the following namespaces:
java:comp, java:module, java:app, java:global
with and without the env/ suffix.
--
Ceki Gülcü
Sponsoring SLF4J/logback/reload4j at https://github.com/sponsors/qos-ch
On 3/30/2022 3:01 PM, Hendrik Stichweh wrote:
> I'm running a program on a WebSphere Liberty 21.0.0.11 with logging from
> logback 1.2.11.
>
> I have a log output folder specified in my server.xml as: <jndiEntry
> jndiName="logging/logPath" value="${server.output.dir}/logs"/>
>
> In the logback.xml I read this entry with the line: <insertFromJNDI
> env-entry-name="logging/logPath" as="logPath"/>
>
> This worked in the old logback versions However in the new version of
> logback this name is not allowed as the name now must start with "java:".
>
> So when I tried to change the line to: <insertFromJNDI
> env-entry-name="java:comp/env/logging/logPath" as="logPath"/>
>
> I get
>
> |14:37:59,720 |-ERROR in
> ch.qos.logback.classic.joran.action.InsertFromJNDIAction - Failed to
> lookup JNDI env-entry [java:comp/env/stibam/logPath]
> javax.naming.NamingException: CWNEN1000E: |
>
> Is there an error in my reading out of that JNDI variable?
>
_______________________________________________
logback-user mailing list
logback-user@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user