Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6967261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:17:54+00:00 2026-05-27T16:17:54+00:00

I have application, which uses Spring, Hibernate and Spring Security. My goal is to

  • 0

I have application, which uses Spring, Hibernate and Spring Security. My goal is to have one config (.xml) file for each of these frameworks and load them only once. So basically I want spring-config.xml, hibernate-config.xml, spring-security.xml and web.xml as configuration files. It works now as I want, BUT as I look at deployment logs, there are obviously duplicate entries – beans that are loaded more than one time.

web.xml – http://pastebin.com/7ELvV8fS

spring-config.xml – http://pastebin.com/FVTcNu7L

hibernate-config.xml – http://pastebin.com/xXWbgAex

spring-security.xml – http://pastebin.com/JUycGUNA

GlassFish 3.1 deployment output – http://pastebin.com/53Bgyj2r

As you can see in output, there are few times that spring-config.xml is initiated. Also my custom bean in spring-config.xml is initiated two times.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:17:54+00:00Added an answer on May 27, 2026 at 4:17 pm

    This is happening because you are loading the spring-config again in Spring-security via

        <beans:import resource="/hibernate-config.xml"/>
        <beans:import resource="/spring-config.xml"/>
    

    you could try removing this . By the configuation below, you need not specify a separate context param for spring-security.

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            classpath:spring/spring-security.xml,
            classpath:spring/spring-config.xml
        </param-value>       
    </context-param>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Spring application which uses Hibernate on a PostgreSQL database. I'm trying
I have a JPA/Spring application that uses Hibernate as the JPA provider. In one
We have a web application which uses Struts 2, Spring and Hibernate. Currently a
I have an application which uses Spring and Hibernate. In my database there are
I have an application which uses Spring 2.5 and Hibernate 3. There's a web
I have one application which uses the standard .NET forms authentication cookie, now I
I have a java web application which uses spring webflow as framework. I have
I'm not very experienced in JSP. I have an application, which uses the Spring
I have an existing grails application that uses spring-security plugin for authentication. I would
We have implemented JUnit4 in our application which uses Spring core & JPA with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.