Context namespace element ' Annotation-config ' and its parser class [ Org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser]

Source: Internet
Author: User
Tags addchild

Severity: Exception sending context initialized event to listener instance of class Org.springframework.web.context.ContextLoad Erlistener
Org.springframework.beans.factory.BeanDefinitionStoreException:Unexpected exception parsing XML document from class Path resource [applicationcontext.xml]; Nested exception is Java.lang.IllegalStateException:Context namespace element ' Annotation-config ' and its parser class [O Rg.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] is only available on JDK 1.5 and higher
At Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions ( xmlbeandefinitionreader.java:420)
At Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions ( xmlbeandefinitionreader.java:342)
At Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions ( xmlbeandefinitionreader.java:310)
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:124)
At Org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions ( xmlwebapplicationcontext.java:92)
At Org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory ( abstractrefreshableapplicationcontext.java:123)
At Org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory ( abstractapplicationcontext.java:422)
At Org.springframework.context.support.AbstractApplicationContext.refresh (abstractapplicationcontext.java:352)
At Org.springframework.web.context.ContextLoader.createWebApplicationContext (contextloader.java:255)
At Org.springframework.web.context.ContextLoader.initWebApplicationContext (contextloader.java:199)
At Org.springframework.web.context.ContextLoaderListener.contextInitialized (contextloaderlistener.java:45)
At Org.apache.catalina.core.StandardContext.listenerStart (standardcontext.java:4791)
At Org.apache.catalina.core.StandardContext.startInternal (standardcontext.java:5285)
At Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:150)
At Org.apache.catalina.core.ContainerBase.addChildInternal (containerbase.java:901)
At Org.apache.catalina.core.ContainerBase.addChild (containerbase.java:877)
At Org.apache.catalina.core.StandardHost.addChild (standardhost.java:618)
At Org.apache.catalina.startup.HostConfig.deployDirectory (hostconfig.java:1100)
At Org.apache.catalina.startup.hostconfig$deploydirectory.run (hostconfig.java:1618)
At Java.util.concurrent.executors$runnableadapter.call (executors.java:511)
At Java.util.concurrent.FutureTask.run (futuretask.java:266)
At Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1142)
At Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:617)
At Java.lang.Thread.run (thread.java:745)
caused By:java.lang.IllegalStateException:Context namespace element ' Annotation-config ' and its parser class [Org.sprin Gframework.context.annotation.AnnotationConfigBeanDefinitionParser] is only available on JDK 1.5 and higher
At Org.springframework.context.config.contextnamespacehandler$1.parse (contextnamespacehandler.java:65)
At Org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse (namespacehandlersupport.java:69)
At Org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement ( beandefinitionparserdelegate.java:1297)
At Org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement ( beandefinitionparserdelegate.java:1287)
At Org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions ( defaultbeandefinitiondocumentreader.java:135)
At Org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions ( defaultbeandefinitiondocumentreader.java:92)
At Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions ( xmlbeandefinitionreader.java:507)
At Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions ( xmlbeandefinitionreader.java:398)
... More
September 04, 2014 1:38:09 pm Org.apache.catalina.core.StandardContext startinternal
Severity: Error Listenerstart

Today, before running the program, suddenly reported this error! and started surfing the Internet to find information.

To be sure, this is not the reason for the program itself.

The possible causes are:

1) problem with MyEclipse configuration.

2) problem with JDK version

3) There is a jkdcheckversion method in the spring framework, which is not compatible to 1.8. This problem arises. (This is the root cause)

PS: I suddenly remembered that the JDK was updated a few days ago, updated from the previous 1.7 to 1.8. Reason to find.

Workaround:

1) reduced JDK version (easy, simple)

2) Modify the spring source code, and then compile the generated jar file. (more troublesome, not recommended)

Context namespace element ' Annotation-config ' and its parser class [ Org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.