NiFi 1.25 error when trying to connect to LDAP service: ClassCastException: LdapProvider

I’m trying to add LDAP (not LDAPS) authentication in NiFi 1.25.0 in Windows so that users can login using their network IDs, but I can’t get past this error:

“FactoryBean threw exception on object creation; nested exception is java.lang.ClassCastException: class org.apache.nifi.ldap.LdapProvider”

After a reboot, it takes a couple of minutes to get an error. Between reboots, it takes about 15 seconds. The service never starts.

NiFi runs fine with the default “single-user-authorizer” setup.

When I launch NiFi, no LDAP protocol requests come from my machine, so I’m assuming the code never makes it to the point where it tries to connect. “ClassCastException” sounds like a code error, but I’m assuming my configuration (below) has a problem.

The error log entries include:

ni-fi-bootstrap.log

ERROR [NiFi logging handler] org.apache.nifi.StdErr Failed to start web server: Error creating bean with name ‘niFiWebApiConfiguration’: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name org.springframework.security.config.annotation.method.configuration.PrePostMethodSecurityConfiguration’: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.apache.nifi.web.security.configuration.AuthenticationSecurityConfiguration’: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘authorizer’: FactoryBean threw exception on object creation; nested exception is java.lang.ClassCastException: class org.apache.nifi.ldap.LdapProvider
ERROR [NiFi logging handler] org.apache.nifi.StdErr Shutting down…
INFO [main] org.apache.nifi.bootstrap.RunNiFi NiFi never started. Will not restart NiFi

2024-04-30 09:08:29,954 ERROR [main] o.s.web.context.ContextLoader Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘niFiWebApiConfiguration’: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.springframework.security.config.annotation.method.configuration.PrePostMethodSecurityConfiguration’: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.apache.nifi.web.security.configuration.AuthenticationSecurityConfiguration’: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘authorizer’: FactoryBean threw exception on object creation; nested exception is java.lang.ClassCastException: class org.apache.nifi.ldap.LdapProvider

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.apache.nifi.web.security.configuration.AuthenticationSecurityConfiguration’: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘authorizer’: FactoryBean threw exception on object creation; nested exception is java.lang.ClassCastException: class org.apache.nifi.ldap.LdapProvider

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘authorizer’: FactoryBean threw exception on object creation; nested exception is java.lang.ClassCastException: class org.apache.nifi.ldap.LdapProvider

Caused by: java.lang.ClassCastException: class org.apache.nifi.ldap.LdapProvider

Config settings are below. Our LDAP server is not using SSL/TLS, so there are no config values for Keystore, Truststore, etc.

NiFi.properties:
nifi.security.user.authorizer=ldap-provider
nifi.security.allow.anonymous.authentication=false
nifi.security.user.login.identity.provider=ldap-provider

authorizers.xml:

<authorizer>
    <identifier>ldap-provider</identifier>
    <class>org.apache.nifi.ldap.LdapProvider</class>
</authorizer>

login-identity-providers.xml:

<provider>
    <identifier>ldap-provider</identifier>
    <class>org.apache.nifi.ldap.LdapProvider</class>
    <property name="Authentication Strategy">SIMPLE</property>

    <property name="Manager DN">CN=ourLdapUser,CN=Users,DC=ourDomain,DC=local</property>
    <property name="Manager Password">########</property>

    <property name="TLS - Keystore"></property>
    <property name="TLS - Keystore Password"></property>
    <property name="TLS - Keystore Type"></property>
    <property name="TLS - Truststore"></property>
    <property name="TLS - Truststore Password"></property>
    <property name="TLS - Truststore Type"></property>
    <property name="TLS - Client Auth"></property>
    <property name="TLS - Protocol"></property>
    <property name="TLS - Shutdown Gracefully"></property>

    <property name="Referral Strategy">FOLLOW</property>
    <property name="Connect Timeout">10 secs</property>
    <property name="Read Timeout">10 secs</property>

    <property name="Url">ldap://[ip address]:389</property>
    <property name="User Search Base">CN=Users,DC=ourDomain,DC=local</property>
    <property name="User Search Filter">sAMAccountName={0}</property><!-- also tried uid={0} -->

    <property name="Identity Strategy">USE_USERNAME</property>
    <property name="Authentication Expiration">12 hours</property>
</provider>

(Apologies about the formatting. I’ve been fighting with the editor all morning.)

I’ve tried other config settings for the LDAP authorizer that I found on the web, but the ClassCastException error for LdapProvider always halts execution. I added a set of configs for “ldap-user-group-provider” which requires “composite-configurable-user-group-provider,” “file-access-policy-provider” and “managed-authorizer,” but there was no difference.

I made sure I can access the LDAP server from my machine, and I’ve allowed Java “domain” and “private” access through Windows firewall.

I’ve tried the same settings on Windows 10 and Windows 11.

New contributor

Craig F. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật