Announcement Announcement Module
Collapse
No announcement yet.
Exception on starting with spring security Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception on starting with spring security

    Hi all,

    I try to use spring security taking inspiration from the spring-security-samples-contacts application,
    I get the exception below when tomcat starts:


    Code:
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/applicationContext-security.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition(Ljava/lang/String;)Lorg/springframework/beans/factory/support/BeanDefinitionBuilder;
    Caused by: java.lang.NoSuchMethodError: org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition(Ljava/lang/String;)Lorg/springframework/beans/factory/support/BeanDefinitionBuilder;
    	at org.springframework.security.config.FormLoginBeanDefinitionParser.createFilterBean(FormLoginBeanDefinitionParser.java:122)
    	at org.springframework.security.config.FormLoginBeanDefinitionParser.parse(FormLoginBeanDefinitionParser.java:90)
    	at org.springframework.security.config.HttpSecurityBeanDefinitionParser.parseBasicFormLoginAndOpenID(HttpSecurityBeanDefinitionParser.java:379)
    	at org.springframework.security.config.HttpSecurityBeanDefinitionParser.parse(HttpSecurityBeanDefinitionParser.java:164)
    	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
    	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
    	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:100)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    27 oct. 2008 15:05:39 org.apache.catalina.core.StandardContext listenerStart
    the context file :

    Code:
    <b:beans xmlns="http://www.springframework.org/schema/security"
        xmlns:b="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                            http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.1.xsd">
        <http auto-config="true">
            <intercept-url pattern="/" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
            <intercept-url pattern="/index.jsp" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
        </http>
       <!-- Automatically receives AuthenticationEvent messages -->
       <b:bean id="loggerListener" class="org.springframework.security.event.authentication.LoggerListener"/>
    </b:beans>
    thanks a lot!

  • #2
    Seems to me, that you're

    1. Missing a jar file
    2. have an incorrect version jar file.

    Comment


    • #3
      the list of dependencies:

      aopalliance-1.0
      spring-beans-2.0.8
      spring-context-2.0.8
      spring-core-2.0.8
      spring-web-2.0.8
      spring-security-taglibs-2.0.8
      wich one I forget?
      Last edited by lmk; Oct 27th, 2008, 01:19 PM.

      Comment


      • #4
        See my post here:

        http://forum.springframework.org/sho...09&postcount=3

        Comment


        • #5
          thanks luke,

          I dont found an accurate response anywhere.
          the sample webapp contains : spring-mvc,spring-core,spring-core-tiger-spring-security-acl,spring-dao,spring-jdbc...
          so,
          we dont need all of theme if we have just to test a basic authentication and compare 2 security tools.

          best regards!

          Comment

          Working...
          X