Piotr, I think it is important to differentiate what is a requirement and
what is just another way of achieving something. My employer has several
Tomcat- and JBoss-based JEE applications (using Log4j) and we don't have a
single JNDI usage I know of.

I would like to hear "the functional need" that can't be done in a JEE
application without JNDI. My emphasis is important, since "using JNDI" is
not a functional need.

On Tue, Oct 31, 2023 at 10:55 PM Piotr P. Karwasz <piotr.karw...@gmail.com>
wrote:

> Hi Christian,
>
> On Tue, 31 Oct 2023 at 21:57, Christian Grobmeier <grobme...@apache.org>
> wrote:
> > I am surprised we still have JNDI in the code at all, but this made me
> curious:
> > why do JEE users need JNDI features for logging? Why can't they just use
> the normal log mechanism?
>
> JNDI is basically a bean container/factory that allows Java EE
> applications to retrieve database connection pools, message queues or
> mail sessions (and remote code as a bonus).
> For the JMS appender, JNDI is essential.
> For the JDBC appender there is an alternative: DBCP2 can provide a
> database connection pool via a special connection string.
> The SMTP appender does not use JNDI as far as I remember.
>
> Of course there is an alternative to JNDI also in the Java EE world
> (CDI), but it doesn't work with simple servlet containers like Tomcat.
>
> Piotr
>

Reply via email to