Spring启动无法使用intellij idea

时间:2015-12-23 09:47:03

标签: spring intellij-idea

我尝试从spring主页“https://spring.io/guides/gs/rest-service/”模拟RESTful Web服务。

Gradle编译工作正常,但是当我运行弹簧启动时,我收到以下错误,我不知道可能是什么原因。我是春天新手,有人能帮助我吗?

我的配置详情如下:

Windows 7

Intellij Idea 13.1.3

的Java-8

摇篮-2.10

春季4.2.4

Spring启动错误

    "C:\Program Files\Java\jdk1.8.0_60\bin\java" -Didea.launcher.port=7537 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_60\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\zipfs.jar;C:\Users\Hasnat\IdeaProjects\Test\out\production\Test;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-aop-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-aop-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-aop-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-aspects-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-aspects-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-aspects-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-beans-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-beans-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-beans-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-context-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-context-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-context-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-context-support-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-context-support-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-context-support-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-core-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-core-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-core-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-expression-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-expression-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-expression-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-instrument-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-instrument-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-instrument-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-instrument-tomcat-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-instrument-tomcat-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-instrument-tomcat-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-jdbc-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-jdbc-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-jdbc-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-jms-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-jms-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-jms-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-messaging-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-messaging-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-messaging-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-orm-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-orm-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-orm-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-oxm-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-oxm-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-oxm-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-test-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-test-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-test-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-tx-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-tx-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-tx-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-web-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-web-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-web-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-webmvc-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-webmvc-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-webmvc-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-webmvc-portlet-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-webmvc-portlet-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-webmvc-portlet-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-websocket-4.2.4.RELEASE-javadoc.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-websocket-4.2.4.RELEASE-sources.jar;E:\Hasnat\TMS Team\spring-framework-4.2.4.RELEASE\libs\spring-websocket-4.2.4.RELEASE.jar;E:\Hasnat\TMS Team\spring-boot-1.3.1.RELEASE.jar;E:\Hasnat\TMS Team\spring-boot-autoconfigure-1.3.1.RELEASE.jar;E:\Hasnat\TMS Team\commons-logging-1.2\commons-logging-1.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain hello.Application

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.3.1.RELEASE)

[2015-12-23 15:28:43.990] - 12248 INFO [main] --- hello.Application: Starting Application on K-Hasnat-L1 with PID 12248 (C:\Users\Hasnat\IdeaProjects\Test\out\production\Test started by Hasnat in C:\Users\Hasnat\IdeaProjects\Test)
[2015-12-23 15:28:44.024] - 12248 INFO [main] --- hello.Application: No active profile set, falling back to default profiles: default
[2015-12-23 15:28:44.089] - 12248 INFO [main] --- org.springframework.context.annotation.AnnotationConfigApplicationContext: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@63e2203c: startup date [Wed Dec 23 15:28:44 BDT 2015]; root of context hierarchy
[2015-12-23 15:28:45.193] - 12248 SEVERE [main] --- org.springframework.boot.SpringApplication: Application startup failed
java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration#transactionManager due to org/aopalliance/aop/Advice not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:55)
    at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102)
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:178)
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:140)
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:333)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:764)
    at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:357)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:305)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1124)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1113)
    at hello.Application.main(Application.java:14)
    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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.getDeclaredMethods(Class.java:1975)
    at 

    org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:609)
        at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:521)
        at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:507)
        at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:567)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:683)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:627)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597)
        at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1445)
        at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:975)
        at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:289)
        at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.addBeanType(BeanTypeRegistry.java:278)
        at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.getNamesForType(BeanTypeRegistry.java:259)
        at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:182)
        at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:171)
        at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:139)
        at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:86)
        at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
        ... 21 more
    Caused by: java.lang.ClassNotFoundException: org.aopalliance.aop.Advice
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 41 more

    [2015-12-23 15:28:45.199] - 12248 INFO [main] --- org.springframework.boot.logging.ClasspathLoggingApplicationListener: Application failed to start with classpath: [file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/charsets.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/deploy.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/javaws.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/jce.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/jfr.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/jfxswt.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/jsse.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/management-agent.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/plugin.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/resources.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/rt.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/ext/access-bridge-64.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/ext/cldrdata.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/ext/dnsns.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/ext/jaccess.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/ext/jfxrt.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/ext/localedata.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/ext/nashorn.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/ext/sunec.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/ext/sunjce_provider.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/ext/sunmscapi.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/ext/sunpkcs11.jar, file:/C:/Program%20Files/Java/jdk1.8.0_60/jre/lib/ext/zipfs.jar, file:/C:/Users/Hasnat/IdeaProjects/Test/out/production/Test/, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-aop-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-aop-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-aop-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-aspects-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-aspects-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-aspects-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-beans-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-beans-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-beans-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-context-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-context-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-context-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-context-support-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-context-support-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-context-support-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-core-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-core-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-core-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-expression-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-expression-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-expression-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-instrument-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-instrument-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-instrument-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-instrument-tomcat-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-instrument-tomcat-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-instrument-tomcat-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-jdbc-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-jdbc-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-jdbc-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-jms-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-jms-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-jms-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-messaging-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-messaging-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-messaging-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-orm-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-orm-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-orm-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-oxm-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-oxm-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-oxm-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-test-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-test-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-test-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-tx-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-tx-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-tx-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-web-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-web-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-web-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-webmvc-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-webmvc-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-webmvc-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-webmvc-portlet-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-webmvc-portlet-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-webmvc-portlet-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-websocket-4.2.4.RELEASE-javadoc.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-websocket-4.2.4.RELEASE-sources.jar, file:/E:/Hasnat/TMS%20Team/spring-framework-4.2.4.RELEASE/libs/spring-websocket-4.2.4.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-boot-1.3.1.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/spring-boot-autoconfigure-1.3.1.RELEASE.jar, file:/E:/Hasnat/TMS%20Team/commons-logging-1.2/commons-logging-1.2.jar, file:/C:/Program%20Files%20(x86)/JetBrains/IntelliJ%20IDEA%2013.1.3/lib/idea_rt.jar]

Process finished with exit code 1

Application.java

package hello;

/**
 * Created by Hasnat on 12/23/2015.
 */

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

Greeting.java

package hello;

/**
 * Created by Hasnat on 12/23/2015.
 */

public class Greeting {

    private final long id;
    private final String content;

    public Greeting(long id, String content) {
        this.id = id;
        this.content = content;
    }

    public long getId() {
        return id;
    }

    public String getContent() {
        return content;
    }
}

GreetingController.java

package hello;

import java.util.concurrent.atomic.AtomicLong;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Hasnat on 12/23/2015.
 */


@RestController
public class GreetingController {

    private static final String template = "Hello, %s!";
    private final AtomicLong counter = new AtomicLong();

    @RequestMapping("/greeting")
    public Greeting greeting(@RequestParam(value="name", defaultValue="World") String name) {
        return new Greeting(counter.incrementAndGet(),
                String.format(template, name));
    }
}

的build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.1.RELEASE")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'

jar {
    baseName = 'gs-rest-service'
    version =  '0.1.0'
}

repositories {
    mavenCentral()
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
    compile("org.springframework.boot:spring-boot-starter-web")
    testCompile("junit:junit")
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.10'
}

2 个答案:

答案 0 :(得分:1)

解决。在我将aopalliance-1.0.jar添加到我的项目之后

答案 1 :(得分:0)

尝试运行

gradle bootRun

如果可行,问题在于IDEA缓存。在IDEA的Gradle窗口中按 Refresh 按钮。这将使IDEA与命令行Gradle同步。