Announcement Announcement Module
Collapse
No announcement yet.
The prefix "security" for element "security:http" is not bound. Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • The prefix "security" for element "security:http" is not bound.

    in my applicationContext.xml i put

    Code:
    <?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:aop="http://www.springframework.org/schema/aop"
    
    	xmlns:context="http://www.springframework.org/schema/context"
    
    	xmlns:jee="http://www.springframework.org/schema/jee"
    
    	xmlns:lang="http://www.springframework.org/schema/lang"
    
    	xmlns:p="http://www.springframework.org/schema/p"
    
    	xmlns:tx="http://www.springframework.org/schema/tx"
    
    	xmlns:util="http://www.springframework.org/schema/util"
    
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    
    		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
    
    		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
    
    		http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
    
    		http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
    
    		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
    
    		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
    		
    		http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd">
    
    
        <security:http entry-point-ref="dummyEntryPoint" create-session="always" />
    
    
        
        <bean id="dummyEntryPoint" class="com.teoh.server.DummyEntryPoint" />
    
    
    
    <security:global-method-security secured-annotations="enabled" jsr250-annotations="disabled" />
        
    <bean id="dummyAuthenticationProvider" class="com.teoh.server.DummyAuthenticationProvider">
        <security:custom-authentication-provider />
    </bean>
       
    
    
    
    
    
    
    </beans>



    but I get error
    Code:
    009-05-24 21:49:56,250 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
    2009-05-24 21:49:56,399 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
    org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 38 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The prefix "security" for element "security:http" is not bound.
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:378)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:316)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:284)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
    	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
    	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:125)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:420)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:350)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:254)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:198)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    	at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543)
    	at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
    	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
    	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)
    	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
    	at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:414)
    	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
    	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    	at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
    	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
    	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    	at org.mortbay.jetty.Server.doStart(Server.java:222)
    	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
    	at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:478)
    	at com.google.gwt.dev.HostedMode.doStartUpServer(HostedMode.java:365)
    	at com.google.gwt.dev.HostedModeBase.startUp(HostedModeBase.java:590)
    	at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:397)
    	at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)
    Caused by: org.xml.sax.SAXParseException: The prefix "security" for element "security:http" is not bound.
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
    	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:255)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
    	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
    	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:250)
    	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
    	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:370)
    	... 31 more
    2009-05-24 21:49:56.487 java[17467:80f] [Java CocoaComponent compatibility mode]: Enabled
    Do you know why ?

  • #2
    You only included the schema location not a namespace declaration.

    Comment


    • #3
      You haven't declared the security namespace in the list of xmlns. You should have something like this:

      <beans xmlns="http://www.springframework.org/schema/beans"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xmlns:security="http://www.springframework.org/schema/security"

      ...

      http://www.springframework.org/schema/security

      http://www.springframework.org/schema/security/spring-security-2.0.xsd">

      Comment

      Working...
      X