jdk1.8 spring33.2.9和jdk1.7兼容吗

他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)跟我一起学Spring 3(2)–开发环境配置 - ImportNew
| 标签: ,
注: 本章节仅仅针对刚刚接触Java和Spring的初学者,如果已经配置好开发环境的,请略过此节直接进入。
下面来介绍一下如何配置开发环境,配置包括:
要开发Java程序,首先需要配置JDK(Java Development Kit)。你可以在Oracle的网站上下载最新的。截止自本教程写作的时候[2014年9月],最新的版本是Java SE 8u20,但我仍旧以更多人使用的JDK7作为本教程的JDK。
在下载你的操作系统相应的JDK,我下载的是JDK 7u67。
安装好之后就要配置JAVA_HOME,PATH和CLASSPATH环境变量。
JAVA_HOME : JDK的安装目录
PATH : 告诉系统什么地方可以找到java,javac等程序,就不需要在执行运行程序时,在前面加上一长串路径了
CLASSPATH : 告诉系统从什么地方可以找到编译java程序需要的库
Windows配置
如果是使用Windows NT/2000/XP,右击我的电脑 -&属性 -& 高级 -& 环境变量。如果是使用Windows 7,右击我的电脑 -&属性 -& 左栏高级系统设置 -& 高级 -& 环境变量
图片一 Windows设置环境变量
假设你的JDK安装目录是C:\jdk1.7.0。
新建变量JAVA_HOME: C:\jdk1.7.0
修改或新建变量PATH: %JAVA_HOME%\
修改或新建变量CLASSPATH: .;%JAVA_HOME%/lib/tools.%JAVA_HOME%/lib/dt.jar
设置成功后,打开运行-&CMD,输入java -version得到当前版本。
图片二 Windows查看Java版本
如果使用MacOSX Leopard,它自带有JDK,默认安装在/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/下,不需要另外下载安装。
当然如果你要使用最新的版本,你可以从Oracle的网站上下载。以本教程下载的JDK 7u67,安装默认会放在/Library/Java/JavaVirtualMachines/1.7.0_67.jdk/。
安装之后使用java -version查看版本。如果安装了JDK 7之后仍然显示1.6.0的话,就要更改一下CurrentJDK所指向的路径。
cd /System/Library/Frameworks/JavaVM.framework/Versions/
然后ls -la,输出可能如下:
drwxr-xr-x
drwxr-xr-x
6 00:10 ..
lrwxr-xr-x
6 00:09 1.4 -& CurrentJDK
lrwxr-xr-x
6 00:09 1.4.2 -& CurrentJDK
lrwxr-xr-x
6 00:09 1.5 -& CurrentJDK
lrwxr-xr-x
6 00:09 1.5.0 -& CurrentJDK
lrwxr-xr-x
6 00:09 1.6 -& CurrentJDK
lrwxr-xr-x
6 00:09 1.6.0 -& CurrentJDK
drwxr-xr-x
lrwxr-xr-x
6 00:09 Current -& A
lrwxr-xr-x
8 21:30 CurrentJDK -& /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents
使用下面的命令更改CurrentJDK指向的路径:
sudo ln -fhsv /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents CurrentJDK
然后编辑 ~/.bash_profile,加入以下配置:
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
source ~/.bash_profile
然后再看看java -version的输出结果吧,
[~]$java -version
java version &1.7.0_67&
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
其他系统配置JDK的教程请点击。
多说一句,如果使用IDE开发的话,上面配置JDK的步骤并不是必须的,只不过配置JDK能直接通过java -version快速查看我们是否安装好了JDK。
这个教程的所有例子都是使用Eclipse作为IDE,其他IDE的配置类似。
本教程以配置Eclipse为例。在上下载最新的版本。
下载后解压缩到你觉得方便的目录。譬如,Windows的C:\eclipse,或者Mac的~/Applications/eclipse。
直接双击打开。
图片三 Eclipse
接下来让Eclipse知道JDK放在哪。点击Window & Preferences & Java & Installed JREs & Edit...(Windows)或者Preferences & Java & Installed JREs & Edit...(Mac)
图片四 设置Eclipse的JRE路径
将JRE Home指向的JRE的安装
图片五 设置Eclipse的JRE路径
在下载Spring。
我下载的版本是spring-framework-3.2.9.RELEASE-dist.zip。解压缩放到任意目录,譬如~/spring-framework-3.2.9/
图片五 Spring安装目录
环境配置好之后,准备用Eclipse开发你的第一个HelloWorld程序吧!
中,留下了两个问题,希望读者思考一下这些问题。它们都是开放式的问题,并没有标准答案,笔者根据个人的经历和体会作答。
你使用过Spring吗?你用过它的哪些模块和功能?(如果你使用过Spring MVC,请移步下一题。)
Spring由很多组件组成,主要的组件是一个核心的IoC容器(Beans,BeanFactory, ApplicationContext等等构成),它提供依赖注入,剩下的组件都是围绕这个容器构建的。我主要用它的依赖注入、Spring MVC、事务管理、AOP和Security。
除了Spring MVC,你还知道哪些MVC框架吗?你用过哪些MVC框架?你能比较下它们之间的优缺点吗?
我只用过JSF 1.2,Struts 1和Spring MVC。
它是基于模块(UI)的框架
Java EE标准,它拥有许多自带的模块可以提供很多功能
用EJB作为后台,JSF作为view层的话,兼容性很好
开始学习相对容易
不能很好的支持REST风格的服务
对Ajax的支持较差(据说JSF 2有相当大的改善)
基于请求的框架
Ajax支持较好
支持REST风格的服务
较难写web层的测试用例
文档支持较差
Spring MVC
和Struts一样是基于请求的框架
依赖注入和IoC使得写测试用例很容易
对Ajax支持很好
和Spring的其他模块(如core/aop/orm等)衔接良好
文档很齐全
更多优点请参见
和EJB的兼容不太好
开始接触的时候学习曲线较陡
提供了更详细的,此外还有Grails, Vaadin,GWT,Wicket,Play等,速速去围观吧。
关于作者:
一名在路上的程旭媛
中文环境和英文环境不一样:LocalDateTime dt = LocalDateTime.pars...
关于ImportNew
ImportNew 专注于 Java 技术分享。于日 11:11正式上线。是的,这是一个很特别的时刻 :)
ImportNew 由两个 Java 关键字 import 和 new 组成,意指:Java 开发者学习新知识的网站。 import 可认为是学习和吸收, new 则可认为是新知识、新技术圈子和新朋友……
新浪微博:
推荐微信号
反馈建议:ImportNew.
广告与商务合作QQ:
– 好的话题、有启发的回复、值得信赖的圈子
– 写了文章?看干货?去头条!
– 为IT单身男女服务的征婚传播平台
– 优秀的工具资源导航
– 活跃 & 专业的翻译小组
– 国内外的精选博客文章
– UI,网页,交互和用户体验
– JavaScript, HTML5, CSS
– 专注Android技术分享
– 专注iOS技术分享
– 专注Java技术分享
– 专注Python技术分享
& 2018 ImportNewmaven3 junit4 spring3 jdk8 :junit一直报错,害的我几个星期都是这个错,你妹的!
时间: 06:42:18
&&&& 阅读:4533
&&&& 评论:
&&&& 收藏:0
标签:[org.springframework.test.context.junit4.SpringJUnit4ClassRunner]SpringJUnit4ClassRunner constructor called with [class com.gmq.test.UserTest].[org.springframework.test.context.ContextLoaderUtils]Retrieved @ContextConfiguration [@org.springframework.test.context.ContextConfiguration(inheritInitializers=true, loader=interface org.springframework.test.context.ContextLoader, initializers=[], classes=[], name=, locations=[classpath*:conf/spring.xml], value=[], inheritLocations=true)] for declaring class [com.gmq.test.UserTest].[org.springframework.test.context.ContextLoaderUtils]Resolved context configuration attributes: [ declaringClass = ‘com.gmq.test.UserTest‘, locations = ‘{classpath*:conf/spring.xml}‘, classes = ‘{}‘, inheritLocations = true, initializers = ‘{}‘, inheritInitializers = true, name = [null], contextLoaderClass = ‘org.springframework.test.context.ContextLoader‘][org.springframework.test.context.ContextLoaderUtils]Processing ContextLoader for context configuration attributes [ declaringClass = ‘com.gmq.test.UserTest‘, locations = ‘{classpath*:conf/spring.xml}‘, classes = ‘{}‘, inheritLocations = true, initializers = ‘{}‘, inheritInitializers = true, name = [null], contextLoaderClass = ‘org.springframework.test.context.ContextLoader‘][org.springframework.test.context.ContextLoaderUtils]Using default ContextLoader class [org.springframework.test.context.support.DelegatingSmartContextLoader] for test class [com.gmq.test.UserTest][org.springframework.test.context.ContextLoaderUtils]Processing locations and classes for context configuration attributes [ declaringClass = ‘com.gmq.test.UserTest‘, locations = ‘{classpath*:conf/spring.xml}‘, classes = ‘{}‘, inheritLocations = true, initializers = ‘{}‘, inheritInitializers = true, name = [null], contextLoaderClass = ‘org.springframework.test.context.ContextLoader‘][org.springframework.test.context.support.AbstractDelegatingSmartContextLoader]Delegating to GenericXmlContextLoader to process context configuration [ declaringClass = ‘com.gmq.test.UserTest‘, locations = ‘{classpath*:conf/spring.xml}‘, classes = ‘{}‘, inheritLocations = true, initializers = ‘{}‘, inheritInitializers = true, name = [null], contextLoaderClass = ‘org.springframework.test.context.ContextLoader‘].[org.springframework.test.context.ContextLoaderUtils]Processing context initializers for context configuration attributes [ declaringClass = ‘com.gmq.test.UserTest‘, locations = ‘{classpath*:conf/spring.xml}‘, classes = ‘{}‘, inheritLocations = true, initializers = ‘{}‘, inheritInitializers = true, name = [null], contextLoaderClass = ‘org.springframework.test.context.ContextLoader‘][org.springframework.test.context.ContextLoaderUtils]Could not find an ‘annotation declaring class‘ for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.gmq.test.UserTest][org.springframework.test.context.TestContextManager]@TestExecutionListeners is not present for class [class com.gmq.test.UserTest]: using defaults.[org.springframework.test.context.TestContextManager]Registering TestExecutionListener: or[org.springframework.test.context.TestContextManager]Registering TestExecutionListener: org.springframewor5e025e70[org.springframework.test.context.TestContextManager]Registering TestExecutionListener: org.springfra1fbc7afb[org.springframework.test.context.TestContextManager]Registering TestExecutionListener: org.springframew45c8e616[org.springframework.test.annotation.ProfileValueUtils]Retrieved @ProfileValueSourceConfiguration [null] for test class [com.gmq.test.UserTest][org.springframework.test.annotation.ProfileValueUtils]Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.gmq.test.UserTest][org.springframework.test.annotation.ProfileValueUtils]Retrieved @ProfileValueSourceConfiguration [null] for test class [com.gmq.test.UserTest][org.springframework.test.annotation.ProfileValueUtils]Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.gmq.test.UserTest][org.springframework.test.annotation.ProfileValueUtils]Retrieved @ProfileValueSourceConfiguration [null] for test class [com.gmq.test.UserTest][org.springframework.test.annotation.ProfileValueUtils]Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.gmq.test.UserTest][org.springframework.test.context.TestContextManager]beforeTestClass(): class [class com.gmq.test.UserTest][org.springframework.test.annotation.ProfileValueUtils]Retrieved @ProfileValueSourceConfiguration [null] for test class [com.gmq.test.UserTest][org.springframework.test.annotation.ProfileValueUtils]Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.gmq.test.UserTest][org.springframework.test.context.TestContextManager]prepareTestInstance(): instance [][org.springframework.test.context.support.AbstractDelegatingSmartContextLoader]Delegating to GenericXmlContextLoader to load context from [ testClass = UserTest, locations = ‘{classpath*:conf/spring.xml}‘, classes = ‘{}‘, contextInitializerClasses = ‘[]‘, activeProfiles = ‘{}‘, contextLoader = ‘org.springframework.test.context.support.DelegatingSmartContextLoader‘, parent = [null]].[org.springframework.test.context.support.AbstractGenericContextLoader]Loading ApplicationContext for merged context configuration [[ testClass = UserTest, locations = ‘{classpath*:conf/spring.xml}‘, classes = ‘{}‘, contextInitializerClasses = ‘[]‘, activeProfiles = ‘{}‘, contextLoader = ‘org.springframework.test.context.support.DelegatingSmartContextLoader‘, parent = [null]]].[org.springframework.core.env.StandardEnvironment]Initializing new StandardEnvironment[org.springframework.core.env.StandardEnvironment]Adding [systemProperties] PropertySource with lowest search precedence[org.springframework.core.env.StandardEnvironment]Adding [systemEnvironment] PropertySource with lowest search precedence[org.springframework.core.env.StandardEnvironment]Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment][org.springframework.beans.factory.xml.XmlBeanDefinitionReader]Loading XML bean definitions from URL [file:/G:/workspaces/workspace_gmq/springmvc.demo/target/test-classes/conf/spring.xml][org.springframework.beans.factory.xml.DefaultDocumentLoader]Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl][org.springframework.beans.factory.xml.PluggableSchemaResolver]Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/beans/spring-beans-3.2.xsd][org.springframework.beans.factory.xml.PluggableSchemaResolver]Loading schema mappings from [META-INF/spring.schemas][org.springframework.beans.factory.xml.PluggableSchemaResolver]Loaded schema mappings: {http://mybatis.org/schema/mybatis-spring-1.2.xsd=org/mybatis/spring/config/mybatis-spring-1.2.xsd, http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd=org/springframework/oxm/config/spring-oxm-3.0.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-3.2.xsd, http://www.springframework.org/schema/jee/spring-jee-3.2.xsd=org/springframework/ejb/config/spring-jee-3.2.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd=org/springframework/web/servlet/config/spring-mvc-3.1.xsd, http://www.springframework.org/schema/task/spring-task.xsd=org/springframework/scheduling/config/spring-task-3.2.xsd, http://www.springframework.org/schema/beans/spring-beans-3.1.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd, http://www.springframework.org/schema/cache/spring-cache.xsd=org/springframework/cache/config/spring-cache-3.2.xsd, http://www.springframework.org/schema/aop/spring-aop-3.0.xsd=org/springframework/aop/config/spring-aop-3.0.xsd, http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/task/spring-task-3.1.xsd=org/springframework/scheduling/config/spring-task-3.1.xsd, http://www.springframework.org/schema/oxm/spring-oxm.xsd=org/springframework/oxm/config/spring-oxm-3.2.xsd, http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd, http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd=org/springframework/jdbc/config/spring-jdbc-3.1.xsd, http://www.springframework.org/schema/tool/spring-tool-3.1.xsd=org/springframework/beans/factory/xml/spring-tool-3.1.xsd, http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-3.2.xsd, http://www.springframework.org/schema/jee/spring-jee-3.1.xsd=org/springframework/ejb/config/spring-jee-3.1.xsd, http://www.springframework.org/schema/tx/spring-tx-3.2.xsd=org/springframework/transaction/config/spring-tx-3.2.xsd, http://www.springframework.org/schema/context/spring-context-3.2.xsd=org/springframework/context/config/spring-context-3.2.xsd, http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://www.springframework.org/schema/util/spring-util-3.2.xsd=org/springframework/beans/factory/xml/spring-util-3.2.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd=org/springframework/web/servlet/config/spring-mvc-3.0.xsd, http://www.springframework.org/schema/lang/spring-lang-3.2.xsd=org/springframework/scripting/config/spring-lang-3.2.xsd, http://www.springframework.org/schema/beans/spring-beans-3.0.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd, http://www.springframework.org/schema/cache/spring-cache-3.2.xsd=org/springframework/cache/config/spring-cache-3.2.xsd, http://www.springframework.org/schema/task/spring-task-3.0.xsd=org/springframework/scheduling/config/spring-task-3.0.xsd, http://mybatis.org/schema/mybatis-spring.xsd=org/mybatis/spring/config/mybatis-spring-1.2.xsd, http://www.springframework.org/schema/oxm/spring-oxm-3.2.xsd=org/springframework/oxm/config/spring-oxm-3.2.xsd, http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd=org/springframework/jdbc/config/spring-jdbc-3.0.xsd, http://www.springframework.org/schema/tool/spring-tool-3.0.xsd=org/springframework/beans/factory/xml/spring-tool-3.0.xsd, http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-3.2.xsd, http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd, http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-3.2.xsd, http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd, http://www.springframework.org/schema/aop/spring-aop-3.2.xsd=org/springframework/aop/config/spring-aop-3.2.xsd, http://www.springframework.org/schema/jee/spring-jee-3.0.xsd=org/springframework/ejb/config/spring-jee-3.0.xsd, http://www.springframework.org/schema/tx/spring-tx-3.1.xsd=org/springframework/transaction/config/spring-tx-3.1.xsd, http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/context/spring-context-3.1.xsd=org/springframework/context/config/spring-context-3.1.xsd, http://www.springframework.org/schema/util/spring-util-3.1.xsd=org/springframework/beans/factory/xml/spring-util-3.1.xsd, http://www.springframework.org/schema/lang/spring-lang-3.1.xsd=org/springframework/scripting/config/spring-lang-3.1.xsd, http://www.springframework.org/schema/cache/spring-cache-3.1.xsd=org/springframework/cache/config/spring-cache-3.1.xsd, http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-3.2.xsd, http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-3.2.xsd, http://www.springframework.org/schema/oxm/spring-oxm-3.1.xsd=org/springframework/oxm/config/spring-oxm-3.1.xsd, http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd, http://www.springframework.org/schema/mvc/spring-mvc.xsd=org/springframework/web/servlet/config/spring-mvc-3.2.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd=org/springframework/web/servlet/config/spring-mvc-3.2.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc.xsd=org/springframework/jdbc/config/spring-jdbc-3.2.xsd, http://www.springframework.org/schema/beans/spring-beans-3.2.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd, http://www.springframework.org/schema/aop/spring-aop-3.1.xsd=org/springframework/aop/config/spring-aop-3.1.xsd, http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://www.springframework.org/schema/task/spring-task-3.2.xsd=org/springframework/scheduling/config/spring-task-3.2.xsd, http://www.springframework.org/schema/tx/spring-tx-3.0.xsd=org/springframework/transaction/config/spring-tx-3.0.xsd, http://www.springframework.org/schema/context/spring-context-3.0.xsd=org/springframework/context/config/spring-context-3.0.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-3.2.xsd, http://www.springframework.org/schema/util/spring-util-3.0.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsd, http://www.alibaba.com/schema/stat.xsd=META-INF/stat.xsd, http://www.springframework.org/schema/lang/spring-lang-3.0.xsd=org/springframework/scripting/config/spring-lang-3.0.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd=org/springframework/jdbc/config/spring-jdbc-3.2.xsd, http://www.springframework.org/schema/tool/spring-tool-3.2.xsd=org/springframework/beans/factory/xml/spring-tool-3.2.xsd, http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd}[org.springframework.beans.factory.xml.PluggableSchemaResolver]Found XML schema [http://www.springframework.org/schema/beans/spring-beans-3.2.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-3.2.xsd[org.springframework.beans.factory.xml.PluggableSchemaResolver]Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/context/spring-context-3.2.xsd][org.springframework.beans.factory.xml.PluggableSchemaResolver]Found XML schema [http://www.springframework.org/schema/context/spring-context-3.2.xsd] in classpath: org/springframework/context/config/spring-context-3.2.xsd[org.springframework.beans.factory.xml.PluggableSchemaResolver]Trying to resolve XML entity with public id [null] and system id [http://www.springframework.org/schema/tool/spring-tool-3.2.xsd][org.springframework.beans.factory.xml.PluggableSchemaResolver]Found XML schema [http://www.springframework.org/schema/tool/spring-tool-3.2.xsd] in classpath: org/springframework/beans/factory/xml/spring-tool-3.2.xsd[org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader]Loading bean definitions[org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver]Loaded NamespaceHandler mappings: {http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler, http://www.springframework.org/schema/mvc=org.springframework.web.servlet.config.MvcNamespaceHandler, http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler, http://www.alibaba.com/schema/stat=com.alibaba.druid.support.spring.stat.config.DruidStatNamespaceHandler, http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler, http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler, http://www.springframework.org/schema/jdbc=org.springframework.jdbc.config.JdbcNamespaceHandler, http://www.springframework.org/schema/oxm=org.springframework.oxm.config.OxmNamespaceHandler, http://www.springframework.org/schema/cache=org.springframework.cache.config.CacheNamespaceHandler, http://mybatis.org/schema/mybatis-spring=org.mybatis.spring.config.NamespaceHandler, http://www.springframework.org/schema/c=org.springframework.beans.factory.xml.SimpleConstructorNamespaceHandler, http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler, http://www.springframework.org/schema/task=org.springframework.scheduling.config.TaskNamespaceHandler, http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler, http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler}[org.springframework.context.annotation.ClassPathBeanDefinitionScanner]JSR-250 ‘javax.annotation.ManagedBean‘ found and supported for component scanning[org.springframework.core.io.support.PathMatchingResourcePatternResolver]Looking for matching resources in directory tree [G:\workspaces\workspace_gmq\springmvc.demo\target\classes\com\gmq\service][org.springframework.core.io.support.PathMatchingResourcePatternResolver]Searching directory [G:\workspaces\workspace_gmq\springmvc.demo\target\classes\com\gmq\service] for files matching pattern [G:/workspaces/workspace_gmq/springmvc.demo/target/classes/com/gmq/service/**/*.class][org.springframework.core.io.support.PathMatchingResourcePatternResolver]Searching directory [G:\workspaces\workspace_gmq\springmvc.demo\target\classes\com\gmq\service\impl] for files matching pattern [G:/workspaces/workspace_gmq/springmvc.demo/target/classes/com/gmq/service/**/*.class][org.springframework.core.io.support.PathMatchingResourcePatternResolver]Resolved location pattern [classpath*:com/gmq/service/**/*.class] to resources [file [G:\workspaces\workspace_gmq\springmvc.demo\target\classes\com\gmq\service\impl\UserServiceImpl.class], file [G:\workspaces\workspace_gmq\springmvc.demo\target\classes\com\gmq\service\UserService.class]][org.springframework.context.annotation.ClassPathBeanDefinitionScanner]Scanning file [G:\workspaces\workspace_gmq\springmvc.demo\target\classes\com\gmq\service\impl\UserServiceImpl.class][org.springframework.test.context.TestContextManager]Caught exception while allowing TestExecutionListener [or] to prepare test instance []java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99) at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:122) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:105) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:74) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:312) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [G:\workspaces\workspace_gmq\springmvc.demo\target\classes\com\gmq\service\impl\UserServiceImpl.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn‘t supported yet: file [G:\workspaces\workspace_gmq\springmvc.demo\target\classes\com\gmq\service\impl\UserServiceImpl.class]; nested exception is java.lang.IllegalArgumentException at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:290) at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242) at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1438) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:185) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243) at org.springframework.test.context.support.AbstractGenericContextLoader.loadBeanDefinitions(AbstractGenericContextLoader.java:233) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:117) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60) at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100) at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:248) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91) ... 25 moreCaused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn‘t supported yet: file [G:\workspaces\workspace_gmq\springmvc.demo\target\classes\com\gmq\service\impl\UserServiceImpl.class]; nested exception is java.lang.IllegalArgumentException at org.springframework.core.type.classreading.SimpleMetadataReader.&init&(SimpleMetadataReader.java:56) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80) at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102) at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:266) ... 48 moreCaused by: java.lang.IllegalArgumentException at org.springframework.asm.ClassReader.&init&(Unknown Source) at org.springframework.asm.ClassReader.&init&(Unknown Source) at org.springframework.asm.ClassReader.&init&(Unknown Source) at org.springframework.core.type.classreading.SimpleMetadataReader.&init&(SimpleMetadataReader.java:53) ... 51 more[org.springframework.test.context.TestContextManager]afterTestClass(): class [class com.gmq.test.UserTest][org.springframework.test.context.support.DirtiesContextTestExecutionListener]After test class: context [[ testClass = UserTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [ testClass = UserTest, locations = ‘{classpath*:conf/spring.xml}‘, classes = ‘{}‘, contextInitializerClasses = ‘[]‘, activeProfiles = ‘{}‘, contextLoader = ‘org.springframework.test.context.support.DelegatingSmartContextLoader‘, parent = [null]]]], dirtiesContext [false].
解决方案:
&& java8换成java7 &即(jre8替换为jre7)
fucker!!!!,竟然是这个错误,害死我了!!!擦,你妹的!
好吧spring4之后可以很好的支持java8!!!!
换成了jdk7就好了!!!!标签:原文地址:http://www.cnblogs.com/gmq-sh/p/4599064.html
&&国之画&&&& &&&&chrome插件&&
版权所有 京ICP备号-2
迷上了代码!

我要回帖

更多关于 spring jdk 1.8不兼容 的文章

 

随机推荐