…… are only available on JDK 1.5 and higher 错误
"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 错误的更多相关文章
- …… are only available on JDK 1.5 and higher 错误(spring 的jdk版本检测在jdk 8下的修订)
正常方法 用更高的版本,因为spring向下兼容. 我公司需求的方法(真 迟早跑路) 1.在项目中创建一个package为org.springframework.core 2.在该package下面新 ...
- zookeeper_service 出错 ........... are only available on JDK 1.5 and higher
出错:: ContextLoader:215 ERROR - Context initialization failed org.springframework.beans.factory.Bean ...
- 【原创】大叔经验分享(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 ...
- [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 ...
- 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 ...
- AnnotationConfigBeanDefinitionParser are only available on JDK 1.5 and higher
報錯: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML ...
- 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 ...
- 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 ...
- [转]Tomcat启动报错:AnnotationConfigBeanDefinitionParser are only available on JDK 1.5 and higher
原文地址:https://blog.csdn.net/daochuwenziyao/article/details/54949151 问题描述: 控制台输出AnnotationConfigBeanDe ...
随机推荐
- JAVA8 List排序
先定义一个实体类 @Data @AllArgsConstructor @NoArgsConstructor public class Human { private String name; priv ...
- 黑帆第四季/全集Black Sails迅雷下载
本季看点:<黑帆>本剧是著名海盗故事<金银岛>(Treasure Island)的前传.Starz宣布<Black Sails>已提前获得第四季续订,第四季10集和 ...
- MongoDB索引,性能分析
索引的限制: 索引名称不能超过128个字符 每个集合不能超过64个索引 复合索引不能超过31列 MongoDB 索引语法 db.collection.createIndex({ <field&g ...
- jQuery的attr方法处理checkbox的问题
现象 使用了 jQuery 1.10 的版本,想实现 checkbox 的全部选中和全部取消选中,使用了 attr 的方法,如下: $(elem).attr("checked") ...
- Windows Power Shell简介
Windows PowerShell 是一种命令行外壳程序和脚本环境,使命令行用户和脚本编写者可以利用 .NET Framework的强大功能. 它引入了许多非常有用的新概念,从而进一步扩展了您在 W ...
- CDR话单主要字段介绍
l Time of call connection RRC连接时的时间,格式:yyyy年mm月dd日hh时mm分ss秒 l Call Setup Time per sections 呼叫建立时长 ...
- django的数据库操作
ORM是通过使用描述对象和数据库之间映射的元数据,将程序中的对象自动持久化到关系数据库中,ORM在业务逻辑层和数据库层之间充当了桥梁的作用. django的交互式shell python manage ...
- java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
错误信息 查看Console标签页: 这儿提示找不到HttpServletRequest类. 解决办法 规则文件更新的时候需要调用servlet-api.jar相关的类,如果您的系统环境下无法找到这个 ...
- DLL文件实现窗体的模板模式
机房合作版中第一次使用了模板方法,实现了类似窗体的界面和代码的复用..窗体继承有两种方法,一种是通过继承选择器从已编译的程序集合里选择,另一种则是通过DLL文件的方式继承.个人觉得DLL还是比较方便的 ...
- Windows10系统.NET Framework 3.5离线安装方法
Win10技术预览版给用户们带来很多新功能的同时,也给用户们带来了不害臊的麻烦与问题.其中.NET Framework 4.5是系统预装的,但是在Win10技术预览版中的部分应用需要.NET Fram ...