> If you want to load a file that is under WEB-INF, you don't need to involve the
> class loader at all.  Simply use:
>
>    InputStream is =
>      getServletContext().getResourceAsStream("/WEB-INF/myprops.properties");

Cool.  That works (missed the part about relative to the context
directory
in the javadoc).

But now I'm back to the classloading issue.  I'm trying to use JNDI and
the 
call to load the factory class is failing.  The JNDI code is doing
something
like this to load the factory:

    String className = "com.netscape.jndi.ldap.LdapContextFactory";
    try
      {
      // this works
//       Class c = Class.forName( className );
      // this does not
      ClassLoader loader =
(java.lang.ClassLoader)java.security.AccessController.doPrivileged(new
java.security.PrivilegedAction() {
      
      public java.lang.Object run()
        {
        return java.lang.Thread.currentThread().getContextClassLoader();
        }
      
      });
      Class c = java.lang.Class.forName(className, true, loader);
      log( "Class " + className + " loaded." );
      }
    catch ( Exception e )
      {
      log( "Error loading class " + className + ": " + e );
      return;
      }

I'm seeing a ClassNotFoundException but the jar is definitely in
WEB-INF/lib
and definitely contains com.netscape.jndi.ldap.LdapContextFactory.

Reply via email to