1 Reply Latest reply on Oct 28, 2003 5:30 PM by Mike Finn

    LoginModule and Database

    stani Newbie

      I can not make my LoginModule to interact with database. When I try to access DataSource through JNDI, I get "object not bound" Exception. This is the code:

      java.util.Properties prop = new java.util.Properties();
      prop.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      prop.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      prop.put("java.naming.provider.url", "localhost:1099");
      Context jndiCntx = new InitialContext(prop);
      DataSource ds = (DataSource) jndiCntx.lookup("java:/MySqlDS");

      (Just like in DatabaseServerLoginModule)

      If I try to connect to database directly through DriverManager, I get ClassNotFoundException, although database driver jar file located in the proper default/lib directory.
      Just can not not understand what I am doing wrong.

      Has anyone expirienced the problem?