IntelliJ IDEA 使用 rest client

Posted rapper-start

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IntelliJ IDEA 使用 rest client相关的知识,希望对你有一定的参考价值。

IntelliJ IDEA 使用 rest client

https://blog.csdn.net/qq_37502106/article/details/103183492

 

 

switch environment

 

 

Spring Boot无法使用intellij idea启动应用程序

【中文标题】Spring Boot无法使用intellij idea启动应用程序【英文标题】:Spring boot failing to start application using intellij idea 【发布时间】:2016-03-29 17:10:53 【问题描述】:

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

Gradle 编译工作正常,但是当我运行 Spring Boot 时出现以下错误,我不知道可能是什么原因。我是春天的新手,有人可以帮帮我吗?

我的配置详情是:

Windows 7

Intellij Idea 13.1.3

Java-8

Gradle-2.10

春天 4.2.4

春季启动错误

    "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'

【问题讨论】:

从 build.gradle 中删除 compile("org.springframework.boot:spring-boot-starter-jdbc") 会发生什么?您的示例不需要 JDBC。 没有任何改变:( 也尝试删除compile("org.springframework.boot:spring-boot-starter-aop") 没有。这也不会改变任何事情 【参考方案1】:

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

【讨论】:

如何添加。与行家【参考方案2】:

尝试运行

gradle bootRun

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

【讨论】:

以上是关于IntelliJ IDEA 使用 rest client的主要内容,如果未能解决你的问题,请参考以下文章

Spring Boot无法使用intellij idea启动应用程序

IntelliJ IDEA 实用插件列表

intellij idea 好用的插件 开发java

从 IntelliJ Idea 运行/调试 Spring Boot 应用程序

IntelliJ IDEA1.安装使用IntelliJ IDEA

intellij idea svn怎么比较