1 Reply Latest reply on Feb 15, 2014 6:44 PM by Eduardo Martins

    LdapContext cannot be used

    dfisher Newbie

      I deployed some code that uses an InitialLdapContext and I'm seeing these errors in the logs:


      javax.naming.NotContextException: Not an instance of LdapContext


      It appears that Wildfly sets a custom InitialContextFactoryBuilder when it starts which produces org.jboss.as.naming.InitialContext.

      This custom InitialContext class extends javax.naming.directory.InitialDirContext which I believe has the side-effect of not allowing deployers to use InitialLdapContext, because these context objects perform internal validation that they are of the correct type.

      Is this a bug or do I need to override/customize the InitialContextFactoryBuilder in this case?