- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
当我删除基本应用程序测试时,我有无异常运行的 spring boot 应用程序。但是当我添加应用程序测试类时它显示以下异常
{"@timestamp":"2018-04-23T18:10:39.421+05:30","@version":1,"message":"The following profiles are active: development","logger_name":"com.tmobile.u2.uprising.adjustment.AdjustmentApplicationTests","thread_name":"main","level":"INFO","level_value":20000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:44.914+05:30","@version":1,"message":"HikariPool-1 - Starting...","logger_name":"com.zaxxer.hikari.HikariDataSource","thread_name":"main","level":"INFO","level_value":20000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:44.958+05:30","@version":1,"message":"Registered driver with driverClassName=oracle.jdbc.driver.OracleDriver was not found, trying direct instantiation.","logger_name":"com.zaxxer.hikari.util.DriverDataSource","thread_name":"main","level":"WARN","level_value":30000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:48.794+05:30","@version":1,"message":"HikariPool-1 - Start completed.","logger_name":"com.zaxxer.hikari.HikariDataSource","thread_name":"main","level":"INFO","level_value":20000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:49.315+05:30","@version":1,"message":"HHH000204: Processing PersistenceUnitInfo [\n\tname: default\n\t...]","logger_name":"org.hibernate.jpa.internal.util.LogHelper","thread_name":"main","level":"INFO","level_value":20000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:49.847+05:30","@version":1,"message":"HHH000412: Hibernate Core {5.0.12.Final}","logger_name":"org.hibernate.Version","thread_name":"main","level":"INFO","level_value":20000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:49.857+05:30","@version":1,"message":"HHH000206: hibernate.properties not found","logger_name":"org.hibernate.cfg.Environment","thread_name":"main","level":"INFO","level_value":20000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:49.864+05:30","@version":1,"message":"HHH000021: Bytecode provider name : javassist","logger_name":"org.hibernate.cfg.Environment","thread_name":"main","level":"INFO","level_value":20000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:50.076+05:30","@version":1,"message":"HCANN000001: Hibernate Commons Annotations {5.0.1.Final}","logger_name":"org.hibernate.annotations.common.Version","thread_name":"main","level":"INFO","level_value":20000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:50.839+05:30","@version":1,"message":"HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect","logger_name":"org.hibernate.dialect.Dialect","thread_name":"main","level":"INFO","level_value":20000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:54.583+05:30","@version":1,"message":"HHH90000014: Found use of deprecated [org.hibernate.id.SequenceHiLoGenerator] sequence-based id generator; use org.hibernate.id.enhanced.SequenceStyleGenerator instead. See Hibernate Domain Model Mapping Guide for details.","logger_name":"org.hibernate.orm.deprecation","thread_name":"main","level":"WARN","level_value":30000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:56.251+05:30","@version":1,"message":"HikariPool-1 - Shutdown initiated...","logger_name":"com.zaxxer.hikari.HikariDataSource","thread_name":"main","level":"INFO","level_value":20000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:57.467+05:30","@version":1,"message":"HikariPool-1 - Shutdown completed.","logger_name":"com.zaxxer.hikari.HikariDataSource","thread_name":"main","level":"INFO","level_value":20000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:58.129+05:30","@version":1,"message":"\r\n\r\n***************************\r\nAPPLICATION FAILED TO START\r\n***************************\r\n\r\nDescription:\r\n\r\nParameter 0 of constructor in com.tmobile.u2.uprising.adjustment.factory.AdjustmentFactory required a bean of type 'org.modelmapper.ModelMapper' that could not be found.\r\n\r\n\r\nAction:\r\n\r\nConsider defining a bean of type 'org.modelmapper.ModelMapper' in your configuration.\r\n","logger_name":"org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter","thread_name":"main","level":"ERROR","level_value":40000,"APP_NAME":"adjustmentPublisher"}
{"@timestamp":"2018-04-23T18:10:58.177+05:30","@version":1,"message":"Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@4e096385] to prepare test instance [com.tmobile.u2.uprising.adjustment.AdjustmentApplicationTests@1e5aacd9]","logger_name":"org.springframework.test.context.TestContextManager","thread_name":"main","level":"ERROR","level_value":40000,"stack_trace":"java.lang.IllegalStateException: Failed to load ApplicationContext\r\n\tat org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)\r\n\tat org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)\r\n\tat org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:189)\r\n\tat org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:131)\r\n\tat org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)\r\n\tat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)\r\n\tat org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)\r\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\r\n\tat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)\r\n\tat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)\r\n\tat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)\r\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\r\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\r\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\r\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\r\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\r\n\tat org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)\r\n\tat org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)\r\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\r\n\tat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)\r\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)\r\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)\r\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)\r\n\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)\r\nCaused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adjustmentFactory' defined in file [C:\\Users\\karthikar\\Desktop\\BackUP\\ADJUSTMENT\\adjustmentpublisher\\target\\classes\\com\\tmobile\\u2\\uprising\\adjustment\\factory\\AdjustmentFactory.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.modelmapper.ModelMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}\r\n\tat org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)\r\n\tat org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)\r\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)\r\n\tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)\r\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)\r\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)\r\n\tat org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:303)\r\n\tat org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120)\r\n\tat org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)\r\n\tat org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)\r\n\t... 26 common frames omitted\r\nCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.modelmapper.ModelMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1493)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1104)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)\r\n\tat org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)\r\n\tat org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)\r\n\t... 44 common frames omitted\r\n","APP_NAME":"adjustmentPublisher"}
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 27.377 sec <<< FAILURE! - in com.tmobile.u2.uprising.adjustment.AdjustmentApplicationTests
contextLoads(com.tmobile.u2.uprising.adjustment.AdjustmentApplicationTests) Time elapsed: 0.021 sec <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:189)
at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:131)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adjustmentFactory' defined in file [C:\Users\karthikar\Desktop\BackUP\ADJUSTMENT\adjustmentpublisher\target\classes\com\tmobile\u2\uprising\adjustment\factory\AdjustmentFactory.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.modelmapper.ModelMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:189)
at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:131)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.modelmapper.ModelMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1493)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1104)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:189)
at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:131)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Results :
Tests in error:
AdjustmentApplicationTests.contextLoads » IllegalState Failed to load Applicat...
这是我的 AdjustmentApplicationTests 类:
@SpringBootTest
@RunWith(SpringRunner.class)
public class AdjustmentApplicationTests {
@Test
public void contextLoads() {
}
}
我的 AdjustmentApplication 如下:
@SpringBootApplication
public class AdjustmentApplication {
public static void main(String[] args) {
SpringApplication.run(AdjustmentApplication.class, args);
}
}
下面是我的工厂类:
@Component
public class AdjustmentFactory {
private ModelMapper modelMapper;
@Autowired
public AdjustmentFactory(ModelMapper modelMapper) {
this.modelMapper = modelMapper;
}
......
}
任何人都可以告诉我这里做错了什么。
最佳答案
在任何配置文件或启动器应用程序文件中添加 bean 配置
@Bean
public ModelMapper modelMapper() {
return new ModelMapper();
}
我们应该在我们的组件中使用之前定义bean,否则我们每次都会遇到同样的问题
关于java - Spring boot模型映射器不满足依赖异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49981552/
我想检索具有多个条件的数据,其中每个条件将在特定字段中包含特定关键字。 表结构如下: sid nid cid 数据 50 7 5 ee 50 7 6 AA 50 7 8 ff 51 7 5 ee 51
在 Prolog 中,我经常通过提供模板(包含变量的结构)然后满足其上的一组约束来解决问题。一个简单的例子可能是: go(T) :- T = [_, _, _], member(cat
在设计 FPGA 系统时,我如何粗略估计给定任务所需的逻辑 block 数量? 有人对我对这些常见设备的期望有一个粗略的数量级吗? 串口 使用 CRC32 的数据包解帧器 8 微核 我看过 www.o
我需要编写一段代码,如果函数满足列表中的大多数元素,则返回 True,不满足其中的 false。例如:moreThan odd [1,2,3] 是 True,但是 moreThan odd [1,2,
一旦满足三个条件,我需要使用 componentWillReceiveProps() 来调用我的组件中的方法。其中两个条件将当前 Prop 与下一个 Prop 进行比较,这两个条件通过 Ajax 请求
我正在构建一个主从表单。主视图模型构造细节 View 模型的实例。这些细节 View 模型有几个依赖项,需要用新 类实例来满足。 (这是因为他们需要在独立于主虚拟机的数据上下文中运行的服务层。) 实现
我有以下项目,我已经使用了一段时间。正如您在运行 snnipets 后看到的那样,一切正常。 /* The dark background behind the dialogs */ .dialog-
我正在尝试找出解决此问题的方法: 我想要一个函数来检查文本字段是否填充了文本并且复选框是否被选中。当满足这些条件时,“提交”按钮将启用。如果启用“提交”按钮后不久,用户清除文本字段或取消选中复选框,则
所以我相对较新,我有以下代码,我想知道如何制作这样我可以返回临时变量,同时满足java的返回要求。我希望返回临时值,但由于它位于 if-else block 内,因此从技术上讲,它不会在其外部初始化。
我正在编写一个脚本,该脚本读取文本文件并根据 .txt 文件的内容更改 div 中的文本。 但这不是我的问题。我不想要纯文本,背景颜色应该根据满足 if/elseif/else 函数的条件而改变。 v
我想在 if let 构造中满足多个约束。我知道我们可以使用“,”(逗号)来解包多个值,但它们都必须成功解包。 例如: var str: String? = "Hello" var x: Int? =
当我在 genymotion 模拟设备上安装我的应用程序时,它无法很好地安装,在控制台上我得到“INSTALL_FAILED_CPU_ABI_INCOMPATIBLE”我尝试了另一个应用程序,它安装得
因此,我试图根据数据帧的匹配条件来查看数据帧的两个变量(v1 和 v2)是否在其符号(正数或负数)中匹配变量(ID1==ID2)。 示例数据框 - Trial.df: ID1 v1
如果交付一个 Java 应用程序,它使用 gradle 依赖管理和许多来自 maven-central 的开源库,是否足以检查第一级 depedencies 的许可证(因为他们的依赖关系必须再次自动与
我正在尝试创建一个满足接口(interface) Iterable 的类“Gprogram” (这样我就可以在我的 Gprogram 中迭代 Gcommand)。但是,我只能使用类型 Iterable
我想知道是否可以获得一些帮助。 我试图在查询中写入一个查询,我使用 3 个字段:ID、选项和金额。 我需要对我的唯一 ID 进行分组,然后在该组中我需要按选项白色进行拆分,总计每个选项的金额。例如:编
如何在iOS swift项目中配置Jitsi-meet框架开启视频通话服务? 最佳答案 编辑:这也适用于 Xcode Version 12.2 (12B45b)在 Mac OS Big Sur 上。
我正在玩一些交互式菜单,目前有一个隐藏菜单,当按下一个按钮时,它会从右边出现,并将整个内容移到上面。有点像移动 facebook 应用程序。为了确定按钮应该将菜单滑出还是放回我使用 javascrip
我的目标很简单,使用遗传算法重现经典的“Hello, World”字符串。 我的代码基于此 post .代码主要包含4个部分: 生成具有多个不同个体的种群 根据与target的比较,定义评估个体好坏的
问题陈述 我们有一个雇主想要面试 N 个人,因此安排了 N 个面试时段。每个人都有这些时段的忙闲时间表。给出一个算法,如果可能的话将 N 个人安排到 N 个槽位,如果不可能则返回一个标志/错误/等。最
我是一名优秀的程序员,十分优秀!