当前位置: 首页 > 知识库问答 >
问题:

Spring启动失败启动应用程序使用intellij的想法

陶淳
2023-03-14

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

Gradle编译工作正常,但是当我运行Spring Boot时,我得到了下面的错误,我不知道是什么原因。我是Spring新手,有人能帮我吗?

我的配置详细信息包括:

Windows 7

Intellij Idea 13.1.3

Java-8

Gradle-2.10

Spring4.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

应用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);
    }
}

招呼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;
    }
}

问候ontroller.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));
    }
}

建筑格拉德尔

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个答案

贺山
2023-03-14

尝试运行

gradle bootRun

如果有效,问题是IDEA缓存。在IDEA的Gradle窗口中按下刷新按钮。这将使IDEA与命令行Gradle同步。

岳玉堂
2023-03-14

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

 类似资料:
  • 我是spring的初学者,希望这样做示例项目…我有一个数据库,我想连接到它…我使用了像AutoWired和service这样的注释。但有个问题我解决不了 Controller包中的RegisterationController具有我要调用的服务: 第一个包中的DataManagement类: 第一包中的StudentAccountRepository: 第一包中得学生帐户..引用数据库中的表: M

  • 我无法用IntelliJ中的ThymileAF启动基于Spring Boot的应用程序。我的项目在maven中,当我从命令行启动它时: java-jarmyproject.war 一切正常。但在IDE中配置run应用程序时,出现以下错误: 这是我的pom.xml:

  • > 出错原因:任务“:bootrun”执行失败。 进程'command'/library/java/javavirtualmachines/jdk1.8.0_60.jdk/contents/home/bin/java''以非零退出值1完成 发生异常:2015-08-23 01:37:57.989 WARN 6186---[main]ationConfigEmbeddedWebApplication

  • 我在intellij上启动spring boot应用程序时遇到问题,它失败了,并显示以下消息:与目标VM断开连接,地址:'127.0.0.1:49784',传输:'socket' 过程结束,退出代码为255。以前有人遇到过这种情况吗?

  • 当我启动Spring Boot应用程序时,我得到了: 2020-11-11 03:02:24.333警告20648--[main]ConfigServletWebServerApplicationContext:上下文初始化过程中遇到异常-取消刷新尝试:org.springframework.beans.factory.unsatisfiedDependencyException:创建名为“org

  • 当我运行这个错误时,请帮助我解决这个问题 启动应用程序上下文时出错。要显示条件,请报告启用“调试”后重新运行应用程序。2019-02-11 10:53:55.839错误8804 --- [ restartedMain]o. s. b. d.日志失败分析记者: 应用程序启动失败 说明: com中的字段userDao。实例Spring Security应用程序编程接口。服务UserServiceImp