Menu

#44 Jdbc using JNDI reference fails

closed-rejected
nobody
5
2007-05-24
2007-05-22
No

jGuard v1.0.3 (this option is missing in Group dropdown)

NamingException(NameNotFoundException) "Name jdbc is not bound in this Context" occurs in constructor ConnectionFactory(Map opts)

Occurs in both authentication and authorization.
Configured JNDI string is "jdbc/something".

When replaced this line in the constructor:

Object object = (DataSource) initCtx.lookup(jndiRef);

by:

Context envCtx = (Context) initCtx.lookup("java:comp/env");
Object object = (DataSource) envCtx.lookup(jndiRef);

it starts to work.

Discussion

  • Marek Muller

    Marek Muller - 2007-05-24
    • status: open --> closed-rejected
     
  • Marek Muller

    Marek Muller - 2007-05-24

    Logged In: YES
    user_id=1798841
    Originator: YES

    Another way, how to make it work, is add "java:comp/env/" to JNDI string, as is adviced in JdbcAuthenticationManager JGuard XWiki - and I missed it.

     

Log in to post a comment.