我已从入门指南“构建RESTful Web服务”下载了zip文件。
但是我无法在我的系统上构建(mvn包)。 当maven尝试运行HelloControllerTest
时,我收到以下错误消息Negative matches:
-----------------
ActiveMQAutoConfiguration did not match
- required @ConditionalOnClass classes not found: javax.jms.ConnectionFactory,org.apache.activemq.ActiveMQConnectionFactory (OnClassCondition)
AopAutoConfiguration did not match
- required @ConditionalOnClass classes not found: org.aspectj.lang.annotation.Aspect,org.aspectj.lang.reflect.Advice (OnClassCondition)
ArtemisAutoConfiguration did not match
- required @ConditionalOnClass classes not found: javax.jms.ConnectionFactory,org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory (OnClassCondition)
AuditAutoConfiguration#authenticationAuditListener did not match
- required @ConditionalOnClass classes not found: org.springframework.security.authentication.event.AbstractAuthenticationEvent (OnClassCondition)
AuditAutoConfiguration#authorizationAuditListener did not match
- required @ConditionalOnClass classes not found: org.springframework.security.access.event.AbstractAuthorizationEvent (OnClassCondition)
BatchAutoConfiguration did not match
- required @ConditionalOnClass classes not found: org.springframework.batch.core.launch.JobLauncher,org.springframework.jdbc.core.JdbcOperations (OnClassCondition)
CacheAutoConfiguration did not match
- @ConditionalOnClass classes found: org.springframework.cache.CacheManager (OnClassCondition)
- @ConditionalOnBean (types: org.springframework.cache.interceptor.CacheAspectSupport; SearchStrategy: all) found no beans (OnBeanCondition)
CacheAutoConfiguration.CacheManagerJpaDependencyConfiguration did not match
- required @ConditionalOnClass classes not found: org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean (OnClassCondition)
- Ancestor 'org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration' did not match (ConditionEvaluationReport.AncestorsMatchedCondition)
CacheStatisticsAutoConfiguration did not match
- @ConditionalOnBean (types: org.springframework.cache.CacheManager; SearchStrategy: all) found no beans (OnBeanCondition)
CacheStatisticsAutoConfiguration.CaffeineCacheStatisticsProviderConfiguration did not match
- required @ConditionalOnClass classes not found: com.github.benmanes.caffeine.cache.Caffeine,org.springframework.cache.caffeine.CaffeineCacheManager (OnClassCondition)
- Ancestor 'org.springframework.boot.actuate.autoconfigure.CacheStatisticsAutoConfiguration' did not match (ConditionEvaluationReport.AncestorsMatchedCondition)
CacheStatisticsAutoConfiguration.ConcurrentMapCacheStatisticsConfiguration did not match
- @ConditionalOnClass classes found: org.springframework.cache.concurrent.ConcurrentMapCache (OnClassCondition)
- Ancestor 'org.springframework.boot.actuate.autoconfigure.CacheStatisticsAutoConfiguration' did not match (ConditionEvaluationReport.AncestorsMatchedCondition)
CacheStatisticsAutoConfiguration.EhCacheCacheStatisticsProviderConfiguration did not match
- required @ConditionalOnClass classes not found: org.springframework.cache.ehcache.EhCacheCache,net.sf.ehcache.Ehcache,net.sf.ehcache.statistics.StatisticsGateway (OnClassCondition)
- Ancestor 'org.springframework.boot.actuate.autoconfigure.CacheStatisticsAutoConfiguration' did not match (ConditionEvaluationReport.AncestorsMatchedCondition)
CacheStatisticsAutoConfiguration.GuavaCacheStatisticsConfiguration did not match
- required @ConditionalOnClass classes not found: com.google.common.cache.Cache,org.springframework.cache.guava.GuavaCache (OnClassCondition)
- Ancestor 'org.springframework.boot.actuate.autoconfigure.CacheStatisticsAutoConfiguration' did not match (ConditionEvaluationReport.AncestorsMatchedCondition)
CacheStatisticsAutoConfiguration.HazelcastCacheStatisticsConfiguration did not match
- required @ConditionalOnClass classes not found: com.hazelcast.core.IMap,com.hazelcast.spring.cache.HazelcastCache (OnClassCondition)
- Ancestor 'org.springframework.boot.actuate.autoconfigure.CacheStatisticsAutoConfiguration' did not match (ConditionEvaluationReport.AncestorsMatchedCondition)
CacheStatisticsAutoConfiguration.InfinispanCacheStatisticsProviderConfiguration did not match
- required @ConditionalOnClass classes not found: org.infinispan.spring.provider.SpringCache (OnClassCondition)
- Ancestor 'org.springframework.boot.actuate.autoconfigure.CacheStatisticsAutoConfiguration' did not match (ConditionEvaluationReport.AncestorsMatchedCondition)
CacheStatisticsAutoConfiguration.JCacheCacheStatisticsProviderConfiguration did not match
- required @ConditionalOnClass classes not found: javax.cache.Caching,org.springframework.cache.jcache.JCacheCache (OnClassCondition)
- Ancestor 'org.springframework.boot.actuate.autoconfigure.CacheStatisticsAutoConfiguration' did not match (ConditionEvaluationReport.AncestorsMatchedCondition)
CacheStatisticsAutoConfiguration.NoOpCacheStatisticsConfiguration did not match
- @ConditionalOnClass classes found: org.springframework.cache.support.NoOpCacheManager (OnClassCondition)
- Ancestor 'org.springframework.boot.actuate.autoconfigure.CacheStatisticsAutoConfiguration' did not match (ConditionEvaluationReport.AncestorsMatchedCondition)
CaffeineCacheConfiguration did not match
- required @ConditionalOnClass classes not found: com.github.benmanes.caffeine.cache.Caffeine,org.springframework.cache.caffeine.CaffeineCacheManager (OnClassCondition)
我删除了所有测试并试图运行应用程序(mvn spring-boot:run)。现在我只是得到以下回复:
2016-09-02 12:13:00.959 INFO 14020 --- [ main] hello.Application : Starting Application on myHost with PID 14020 (C:\Users\myUser\Desktop\gs-spring-boot-master\comp lete\target\classes started by myUser in C:\Users\myUser\Desktop\gs-spring-boot-master\complete) 2016-09-02 12:13:00.964 INFO 14020 --- [ main] hello.Application : No active profile set, falling back to default profiles: default 2016-09-02 12:13:01.080 INFO 14020 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@438b2516: star tup date [Fri Sep 02 12:13:01 CEST 2016]; root of context hierarchy 2016-09-02 12:13:03.423 INFO 14020 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup 2016-09-02 12:13:03.433 INFO 14020 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0 Let's inspect the beans provided by Spring Boot: 2016-09-02 12:13:03.563 INFO 14020 --- [ main] hello.Application : Started Application in 3.219 seconds (JVM running for 8.376) [INFO]
------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO]
------------------------------------------------------------------------ [INFO] Total time: 7.018 s [INFO] Finished at: 2016-09-02T12:13:03+02:00 [INFO] Final Memory: 36M/308M [INFO]
------------------------------------------------------------------------ 2016-09-02 12:13:03.888 INFO 14020 --- [ Thread-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@438b2516: startup date [Fri Sep 02 12:13:01 CEST 2016]; root of context hierarchy 2016-09-02 12:13:03.892 INFO 14020 --- [ Thread-1] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0 2016-09-02 12:13:03.895 INFO 14020 --- [ Thread-1] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
我希望将使用ConfigEmbeddedWebApplicationContext。但是使用了AnnotationConfigApplicationContext。没有tomcat开始!
我正在使用: Maven 3.3.9 Jdk 1.8 Windows 7
欢迎任何帮助。 谢谢Jörg
答案 0 :(得分:3)
找到了解决方案。我在本地Maven缓存中发现了一个损坏的tomcat.embed-core-8.5.4依赖项。我删除了它并再次检索了依赖项。现在它有效。