Skip to content

LDAP-profile WAR fails to start after Spring 7 upgrade due to missing entityManager bean #12728

Closed

Description

@mahesh-wor

Description

The application starts Tomcat and begins Spring/Hibernate initialization successfully, but fails while creating the Spring Security filter chain. The LDAP security configuration references filters that depend on an entityManager bean, but the LDAP geostore-spring-security.xml does not define that bean.

mapstore.war built with ldap profiles, fails to load with the following Error.
error.log

How to reproduce

Build with profiles: ldap,printing, > Run with valid ldap.properties + ldap setup.

Expected Result
Mapstore should run with ldap enabled profiles.

Current Result
Mapstore fails to load, Error 404. Check error.log above.

  • Not browser related
Browser info (use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Affected Version
Internet Explorer
Edge
Chrome
Firefox
Safari

Other useful information

Updating /usr/local/tomcat/webapps/mapstore/WEB-INF/classes/geostore-spring-security.xml with the following seems to work as a temporary measure.

....
    </security:http>

    <bean id="entityManager"
          class="org.springframework.orm.jpa.support.SharedEntityManagerBean">
        <property name="entityManagerFactory" ref="geostoreEntityManagerFactory"/>
        <property name="persistenceUnitName" value="geostore"/>
    </bean>

    <!-- Entry point -->
    <bean id="restAuthenticationEntryPoint" class="it.geosolutions.geostore.services.rest.security.RestAuthenticationEntryPoint" >
....

Security vulnerabilities

Do not report security vulnerabilities in public issues.

If you believe you have found a vulnerability in MapStore, please use GitHub private vulnerability reporting or contact the security address listed in SECURITY.md.

Activity

  1. added theissue type on Jul 24, 2026
  2. added this to the 2026.03.00 milestone on Jul 24, 2026
  3. offtherailz commented on Jul 24, 2026

    @offtherailz
    Member

    Reproduced on master. The cause is the Spring 7 upgrade (#12428): it added depends-on="entityManager" to the token filters in both the db and ldap security configs, but added the entityManager bean definition only to the db configs. So the ldap configs reference a bean that is never defined.
    Two notes for the fix:

    • It belongs in the source config files, not the deployed WAR.
    • There are two ldap files that need it: product/config/ldap/geostore-spring-security-ldap.xml and web/src/config/ldap/geostore-spring-security-ldap.xml.

    Opened #12729 with the fix. Tested against the acme-ldap server from the docs: login as bill/hello works with the ADMIN role.

  4. added a commit that references this issue on Jul 24, 2026
    85310a9
  5. added 2 commits that reference this issue on Jul 28, 2026
    6aacd82
    4804c6d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions