title: Spring migration from 2.5.6 to 4.3.6
body: <p>I has an application with <strong>Spring 2.5.6</strong> running with <strong>JDK 1.6</strong>. I changed to version <strong>4.3.6</strong> to use <strong>JDK 1.8</strong>.</p>
  
  <p>Already changed some methods and imports...</p>
  
  <p>There is no more compilation erros.</p>
  
  <p>But when I try to start the application with Jetty i got the following error:</p>
  
  <pre><code>[WARNING] Nested in org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:spring-security-config.xml]
  Offending resource: class path resource [beanRefFacory.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 18 in XML document from class path resource [spring-security-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 18; columnNumber: 58; cvc-complex-type.2.4.c: O curinga correspondente é restrito, mas nenhuma declaração pode ser encontrada para o elemento 'security:http'.:
  org.xml.sax.SAXParseException; lineNumber: 18; columnNumber: 58; cvc-complex-type.2.4.c: O curinga correspondente é restrito, mas nenhuma declaração pode ser encontrada para o elemento 'security:http'.
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)
      at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:458)
      at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3237)
      at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1917)
      at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:746)
      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:379)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
      at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
      at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
      at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:429)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:227)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:184)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:169)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:142)
      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
      at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
      at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
      at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
      at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:613)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:514)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
      at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
      at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
      at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
      at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
      at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
      at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:115)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
      at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
      at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
      at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
      at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
      at org.mortbay.jetty.Server.doStart(Server.java:224)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
      at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
      at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:441)
      at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:383)
      at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:210)
      at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  </code></pre>
  
  <p>Someone can help me with that?</p>
  
  <p>edit:
  This is my <em>spring-security-config.xml</em> (<strong>not changed during migration</strong>):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:security="http://www.springframework.org/schema/security"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
      xmlns:lang="http://www.springframework.org/schema/lang" xmlns:p="http://www.springframework.org/schema/p"
      xmlns:util="http://www.springframework.org/schema/util" xmlns:camel="http://activemq.apache.org/camel/schema/spring"
      xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/security  http://www.springframework.org/schema/security/spring-security-2.0.2.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
          http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
          http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
          http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
          http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
          http://www.springframework.org/schema/tx  http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"&gt;
  
      &lt;security:http entry-point-ref="myAuthenticationEntryPoint"
          auto-config="false" session-fixation-protection="none"&gt;
  
          &lt;security:intercept-url pattern="/login.iface"
              filters="none" /&gt;
          &lt;security:intercept-url pattern="/img/**"
              filters="none" /&gt;
          &lt;security:intercept-url pattern="/css/**"
              filters="none" /&gt;
          &lt;security:intercept-url pattern="/scripts/**"
              filters="none" /&gt;
          &lt;security:intercept-url pattern="/app/**"
              access="IS_AUTHENTICATED_FULLY" /&gt;
          &lt;!-- &lt;security:form-login login-page="/login.iface" default-target-url="/app/index.iface" 
              authentication-failure-url="/login.iface?login_error=true" /&gt; --&gt;
          &lt;security:logout logout-success-url="/login.jspx" /&gt;
      &lt;/security:http&gt;
  
      &lt;!-- Utilize 192.168.236.111 quando for testar local &lt;security:ldap-server 
          url="${SOME.PROPERTY}" id="LDAPServer" /&gt; --&gt;
      &lt;bean id="memcachedLogin"
          class="br.com.tpd.cac.thinkcat.memcached.MemCachedResourcesImpl"&gt;
          &lt;constructor-arg value="${SOME.PROPERTY}" /&gt;
          &lt;property name="timetoSet" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="sessionTimeout" value="${SOME.PROPERTY}" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- ************************************************************* *** Customized 
          LDAP Security Authentication/Authorization *** ************************************************************* --&gt;
      &lt;bean id="contextSource"
          class="org.springframework.security.ldap.DefaultSpringSecurityContextSource"&gt;
          &lt;constructor-arg value="${SOME.PROPERTY}" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="poolingContextSource"
          class="org.springframework.ldap.pool.factory.PoolingContextSource"
          destroy-method="close"&gt;
          &lt;property name="contextSource" ref="contextSource" /&gt;
          &lt;property name="dirContextValidator" ref="dirContextValidator" /&gt;
          &lt;property name="minIdle" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="maxIdle" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="maxActive" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="maxTotal" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="maxWait" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="testOnBorrow" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="testWhileIdle" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="timeBetweenEvictionRunsMillis"
              value="${SOME.PROPERTY}" /&gt;
          &lt;property name="minEvictableIdleTimeMillis"
              value="${SOME.PROPERTY}" /&gt;
          &lt;property name="numTestsPerEvictionRun"
              value="${SOME.PROPERTY}" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="dirContextValidator"
          class="org.springframework.ldap.pool.validation.DefaultDirContextValidator" /&gt;
  
  
  
      &lt;bean id="ldapAuthProvider"
          class="org.springframework.security.providers.ldap.LdapAuthenticationProvider"&gt;
  
          &lt;security:custom-authentication-provider /&gt;
  
          &lt;constructor-arg&gt;
              &lt;bean
                  class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator"&gt;
                  &lt;constructor-arg ref="contextSource" /&gt;
                  &lt;property name="userDnPatterns"&gt;
                      &lt;!-- &lt;list&gt;&lt;value&gt;uid={0},ou=people,dc=portalsigres,dc=com&lt;/value&gt;&lt;/list&gt; --&gt;
                      &lt;list&gt;
                          &lt;value&gt;${SOME.PROPERTY}&lt;/value&gt;
                      &lt;/list&gt;
                  &lt;/property&gt;
              &lt;/bean&gt;
          &lt;/constructor-arg&gt;
  
          &lt;constructor-arg&gt;
              &lt;bean id="ThinkCATWebLdapUserDetails" class="br.com.tpd.cac.thinkcat.security.ldap.LdapUserDetails"&gt;
                  &lt;constructor-arg ref="contextSource" /&gt;
                  &lt;constructor-arg value="${SOME.PROPERTY}" /&gt;
              &lt;/bean&gt;
          &lt;/constructor-arg&gt;
  
      &lt;/bean&gt;
  
      &lt;!-- ************************************************************* *** Customized 
          LDAP Security Authentication/Authorization *** ************************************************************* --&gt;
  
  
      &lt;!-- LDAP TEMPLATE --&gt;
  
      &lt;bean id="LDAPTemplateContext" class="net.sf.ldaptemplate.support.LdapContextSource"&gt;
          &lt;property name="url" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="base" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="userName" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="password" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="dirObjectFactory"
              value="org.springframework.ldap.core.support.DefaultDirObjectFactory" /&gt;
          &lt;!-- Dont use sun ldap pool. Use poolContextSource instead --&gt;
          &lt;property name="pooled" value="false" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="ldapTemplate" class="net.sf.ldaptemplate.LdapTemplate"&gt;
          &lt;constructor-arg ref="LDAPTemplateContext" /&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="sessionRegistry"
          class="org.springframework.security.concurrent.SessionRegistryImpl" /&gt;
  
      &lt;bean id="defaultConcurrentSessionController"
          class="br.com.tpd.cac.thinkcat.security.acesso.DMConcurrentSessionController"&gt;
          &lt;property name="sessionRegistry" ref="sessionRegistry" /&gt;
          &lt;property name="exceptionIfMaximumExceeded" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="cache" ref="memcachedLogin" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager"&gt;
          &lt;property name="providers"&gt;
              &lt;list&gt;
                  &lt;ref local="ldapAuthProvider" /&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="sessionController" ref="defaultConcurrentSessionController" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="sucessfulAuthenticationCallbackImpl"
          class="br.com.tpd.cac.thinkcat.security.acesso.SuccessfulAuthenticationCallbackImpl"&gt;
          &lt;property name="sessionTimeout" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="cache" ref="memcachedLogin" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="myAuthenticationEntryPoint"
          class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint"&gt;
          &lt;property name="loginFormUrl" value="/login.iface" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="authenticationProcessingFilter"
          class="br.com.tpd.cac.thinkcat.security.acesso.DMAuthenticationProcessingFilter"&gt;
          &lt;security:custom-filter position="AUTHENTICATION_PROCESSING_FILTER" /&gt;
          &lt;property name="defaultTargetUrl" value="/app/index.iface" /&gt;
          &lt;property name="authenticationManager" ref="authenticationManager" /&gt;
          &lt;property name="authenticationFailureUrl" value="/login.iface?login_error=true" /&gt;
          &lt;property name="allowSessionCreation" value="true" /&gt;
          &lt;property name="callback" ref="sucessfulAuthenticationCallbackImpl" /&gt;
          &lt;property name="rememberMeServices" ref="rememberMeServices" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="rememberMeAuthenticationManager"
          class="br.com.tpd.cac.thinkcat.security.acesso.RememberMeAuthenticationManager"&gt;
          &lt;property name="providers"&gt;
              &lt;list&gt;
                  &lt;ref local="ldapAuthProvider" /&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="rememberMeProcessingFilter"
          class="br.com.tpd.cac.thinkcat.security.acesso.RememberMeAuthFilter"&gt;
          &lt;security:custom-filter position="REMEMBER_ME_FILTER" /&gt;
          &lt;property name="authenticationManager" ref="rememberMeAuthenticationManager" /&gt;
          &lt;property name="rememberMeServices" ref="rememberMeServices" /&gt;
          &lt;property name="cache" ref="memcachedLogin" /&gt;
          &lt;property name="bloqueioMultiploAcesso" value="${SOME.PROPERTY}" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="pdrUserDetails"
          class="br.com.tpd.cac.thinkcat.security.ldap.PDRUserDetailsService" /&gt;
  
      &lt;bean id="rememberMeServices"
          class="br.com.tpd.cac.thinkcat.security.acesso.TokenBasedRememberMeServices"&gt;
          &lt;property name="userDetailsService" ref="pdrUserDetails" /&gt;
          &lt;property name="key" value="DM_REMEMBERME_KEY" /&gt;
          &lt;property name="sessionTimeout" value="${SOME.PROPERTY}" /&gt;
          &lt;property name="cache" ref="memcachedLogin" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="rememberMeAuthenticationProvider"
          class="org.springframework.security.providers.rememberme.RememberMeAuthenticationProvider"&gt;
          &lt;security:custom-authentication-provider /&gt;
          &lt;property name="key" value="whatever" /&gt;
      &lt;/bean&gt;
  &lt;/beans&gt; 
  </code></pre>