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

  • SEARCH
  • Home
  • 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 8211653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:30:01+00:00 2026-06-07T10:30:01+00:00

I want to delegate the security of my project in Spring Security, but when

  • 0

I want to delegate the security of my project in Spring Security, but when I add the dependencies to my POM and start the server I get an error that doesn’t make sense… it says that my applicationContext.xml has an error and it points to the line where I have an aop sentence…

Here is a reduced version of my applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="  
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd  
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd  
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd  
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">

 <!-- Activates scanning of @Autowired -->
    <context:annotation-config/>

    <!-- Activates scanning of @Repository and @Service -->
    <context:component-scan base-package="es.myproject"/>

    <!-- datasource configuration -->
    <context:property-placeholder location="classpath:jdbc.properties" />

    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="${jndi.name}" />
        <property name="lookupOnStartup" value="true"></property>
        <property name="cache" value="true"></property>
        <property name="proxyInterface" value="javax.sql.DataSource"></property>
    </bean>

    <!-- hibernate session factory -->
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource"  ref="dataSource" />
        <property name="configLocation" value="classpath:hibernate.cfg.xml" />
        <property name="packagesToScan" value="es.myproject.modelo.datos" />
    </bean>

    <!-- enable the configuration of transactional behavior based on annotations -->
    <aop:aspectj-autoproxy />
    <tx:annotation-driven transaction-manager="transactionManager" />

    <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>

</beans>

These are de dependencies:

<!-- Spring security -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>3.1.0.RELEASE</version>    

        </dependency> 
       <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>3.1.0.RELEASE</version> 
        </dependency>   
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>

And the error points to <aop:aspectj-autoproxy /> in the applicationContext.xml

If I delete the Spring Security dependencies, the error goes away… weird huh? Any ideas anybody?

The error says:
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/aop/spring-aop-3.1.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 41 in XML document from ServletContext resource [/WEB-INF/classes/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'aop:aspectj-autoproxy'.

But there’s no real problem with reading that xsd, as I said if I delete the spring security dependencies this error doesn’t show…

  • 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-06-07T10:30:02+00:00Added an answer on June 7, 2026 at 10:30 am

    Strange. Your XML is valid (according to the W3 validator), and your bean definitions all look reasonable. That makes me think this is a classpath issue. Make sure that you have the following jars in your classpath:

    • aopalliance-1.0.jar
    • commons-logging-1.0.1.jar
    • spring-aop-3.1.0.RELEASE.jar
    • spring-asm-3.1.0.RELEASE.jar
    • spring-beans-3.1.0.RELEASE.jar
    • spring-context-3.1.0.RELEASE.jar
    • spring-core-3.1.0.RELEASE.jar
    • spring-expression-3.1.0.RELEASE.jar
    • spring-jdbc-3.1.0.RELEASE.jar
    • spring-orm-3.1.0.RELEASE.jar
    • spring-security-core-3.1.0.RELEASE.jar
    • spring-security-web-3.1.0.RELEASE.jar
    • spring-tx-3.1.0.RELEASE.jar
    • spring-web-3.1.0.RELEASE.jar

    Also make sure that none of these appears multiple times (possibly with a different version)

    Ah, re-reading your question, the problem may be that you don’t explicitly list Spring 3.1.x as dependency. Spring Security 3.1.x only pulls Spring core 3.0.7 unless you explicitly request otherwise.

    Add these dependencies and you should be safe:

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want AddContentViewController to have two delegate, but keeping getting error, how can I
I want to pass data from second tab to first tab using delegates.But delegate
I want to effectively throttle an event stream, so that my delegate is called
I have two UIWebView objects that share the same delegate. I want the delegate
i m presenting modalviewcontroller without using delegate protocol. But want to dismiss modalviewcontroller using
I have a UIViewController that implements TableViews delegate and datasource protocols. Now I want
I have 2 parts of my class that want it to be the delegate.
I have a ViewController with a nib file and want to delegate code that
I am looking for something like Action but I want it to be delegate
I want to convert bind function into delegate but I want to change so

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.