"C:\Program Files\Java\jdk1.8.0_73\bin\java" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:D:\softwares\idea\IntelliJ IDEA 2017.1\lib\idea_rt.jar=65398:D:\softwares\idea\IntelliJ IDEA 2017.1\bin" -Dfile.encoding=UTF-8 -classpath "D:\softwares\idea\IntelliJ IDEA 2017.1\lib\idea_rt.jar;D:\softwares\idea\IntelliJ IDEA 2017.1\plugins\junit\lib\junit-rt.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\classes;D:\softwares\idea\IntelliJ IDEA 2017.1\lib\junit-4.12.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\antlr-2.7.6.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\aspectjrt.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\aspectjweaver.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\c3p0-0.9.1.2.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\cglib-nodep-2.1_3.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\common-annotations.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\commons-collections-3.1.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\commons-fileupload-1.2.1.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\commons-logging-1.0.4.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\commons-logging.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\dom4j-1.6.1.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\ehcache-1.2.3.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\ejb3-persistence.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\freemarker-2.3.15.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\hibernate-annotations.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\hibernate-cglib-repack-2.1_3.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\hibernate-commons-annotations.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\hibernate-entitymanager.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\hibernate3.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\javassist-3.4.GA.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\jstl.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\jta-1.1.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\log4j-1.2.15.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\mysql-connector-java-3.1.13-bin.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\ognl-2.7.3.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\slf4j-api-1.5.2.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\slf4j-log4j12.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\spring.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\standard.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\struts2-core-2.1.8.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\struts2-spring-plugin-2.1.8.jar;F:\IntelliJProject\SSH2\WebRoot\WEB-INF\lib\xwork-core-2.1.6.jar;F:\ssh\SSH2\junit-4.8.2.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\rt.jar;F:\IntelliJProject\SSH2\junit-4.8.2.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 junit.test.EmployeeTest,list
log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlApplicationContext).
log4j:WARN Please initialize the log4j system properly.
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [beans.xml]; nested exception is java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are 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.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)
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.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at junit.test.EmployeeTest.setUpBeforeClass(EmployeeTest.java:20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are 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)
... 28 more

java.lang.NullPointerException
at junit.test.EmployeeTest.list(EmployeeTest.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Process finished with exit code -1

1、在项目中创建一个package为org.springframework.core 
2、在该package下面新建JdkVersion.java,内容如下:

package org.springframework.core;

public abstract class JdkVersion {
public static final int JAVA_13 = ;
public static final int JAVA_14 = ;
public static final int JAVA_15 = ;
public static final int JAVA_16 = ;
public static final int JAVA_17 = ;
//for jre 1.8
public static final int JAVA_18 = ;
private static final String javaVersion = System
.getProperty("java.version");
private static final int majorJavaVersion;
public static String getJavaVersion() {
return javaVersion;
}
public static int getMajorJavaVersion() {
return majorJavaVersion;
}
public static boolean isAtLeastJava14() {
return true;
}
public static boolean isAtLeastJava15() {
return getMajorJavaVersion() >= ;
}
public static boolean isAtLeastJava16() {
return getMajorJavaVersion() >= ;
}
static {
//for jre 1.8
if (javaVersion.indexOf("1.8.") != -) {
majorJavaVersion = ;
}else if (javaVersion.indexOf("1.7.") != -) {
majorJavaVersion = ;
} else if (javaVersion.indexOf("1.6.") != -) {
majorJavaVersion = ;
} else if (javaVersion.indexOf("1.5.") != -) {
majorJavaVersion = ;
} else {
majorJavaVersion = ;
}
}
}

3、到项目的WEB-INF/classes 下面找到对应的package中的JdkVersion.class文件

4、将项目中的spring-core-2.5.6.jar拷贝出来打开,然后将JdkVersion.class替换jar包中的该文件。 
5、将修改后的spring-core-2.5.6.jar再覆盖到项目中。

我是在第二步加入代码再次运行就OK了!

…… are only available on JDK 1.5 and higher 错误的更多相关文章

  1. …… are only available on JDK 1.5 and higher 错误(spring 的jdk版本检测在jdk 8下的修订)

    正常方法 用更高的版本,因为spring向下兼容. 我公司需求的方法(真 迟早跑路) 1.在项目中创建一个package为org.springframework.core 2.在该package下面新 ...

  2. zookeeper_service 出错 ........... are only available on JDK 1.5 and higher

    出错::  ContextLoader:215 ERROR - Context initialization failed org.springframework.beans.factory.Bean ...

  3. 【原创】大叔经验分享(16)Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

    今天尝试运行一个古老的工程,配置好之后编译通过,结果运行时报错: org.springframework.beans.factory.BeanDefinitionStoreException: Une ...

  4. [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher 问题--MyEclipse设置JDK版本

    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML doc ...

  5. spring 2.5.6 错误:Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

    在运行一个第三方公司交付的项目的时候, 出现: Caused by: java.lang.IllegalStateException: Context namespace element 'annot ...

  6. AnnotationConfigBeanDefinitionParser are only available on JDK 1.5 and higher

    報錯: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML ...

  7. Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

    异常信息如下: 错误: Unexpected exception parsing XML document from class path resource [spring/applicationCo ...

  8. Context namespace element 'annotation-config' and its parser class [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] are only available on JDK 1.5 and higher

    Context namespace element 'annotation-config' and its parser class [org.springframework.context.anno ...

  9. [转]Tomcat启动报错:AnnotationConfigBeanDefinitionParser are only available on JDK 1.5 and higher

    原文地址:https://blog.csdn.net/daochuwenziyao/article/details/54949151 问题描述: 控制台输出AnnotationConfigBeanDe ...

随机推荐

  1. Linux学习9-CentOS搭建nginx环境

    前言 之前我们搭建网站的时候,把war包放到tomcat下就能运行起来了,为什么部署上线的时候,又用到了nginx呢? nginx可以做多台服务器的负载均衡,当用户非常少的时候,可以用一台服务直接部署 ...

  2. Thinking in Java---异常处理机制

    java的异常处理机制能够使程序有极好的容错性,让程序更加的健壮.所谓的异常,就是指的阻止当前方法或作用域继续运行的问题,,当程序运行时出现异常时,系统就会自己主动生成一个Exception对象来通知 ...

  3. 【C++】STL常用容器总结之五:双端队列deque

    6.双端队列deque 所谓的deque是”double ended queue”的缩写,双端队列不论在尾部或头部插入元素,都十分迅速.而在中间插入元素则会比较费时,因为必须移动中间其他的元素.双端队 ...

  4. 用开源项目JazzyViewPager实现ViewPager切换动画

    JazzyViewPager这个项目可以让viewpager有各种绚丽的动画,而且还可以自由扩展.但从官网下载的lib导入时会出现找不到视图的问题,不知道是不是我人品不行,所以我就自己写了lib.总之 ...

  5. Apache的三种工作模式

    Web服务器Apache目前一共有三种稳定的MPM(Multi-Processing Module,多进程处理模块)模式. 它们分别是prefork,worker和event,它们同时也代表这Apac ...

  6. [转]mysql 存储过程中使用多游标

    From : http://www.netingcn.com/mysql-procedure-muti-cursor.html mysql的存储过程可以很方便使用游标来实现一些功能,存储过程的写法大致 ...

  7. 在linux机器上面安装anaconda和相关软件

    直接安装anaconda参考这里,主要两条命令: wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh bash ...

  8. quantum theory

    the principles of quantum mechanics by p.a.m.dirac.

  9. AltiumDesigner PCB布局布线过程与技巧

    首先是原理图设计. 原理图设计是前期准备工作,对简单的板子,如果熟练流程,不妨可以跳过.但是对于初学者一定要按流程来,这样一方面可以养成良好的习惯,另一方面对复杂的电路也只有这样才能避免出错.在画原理 ...

  10. [leetcode]Evaluate Reverse Polish Notation @ Python

    原题地址:https://oj.leetcode.com/problems/evaluate-reverse-polish-notation/ 题意: Evaluate the value of an ...