Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Maven Spring启动运行时错误(jar)_Java_Spring_Maven_Spring Mvc_Spring Boot - Fatal编程技术网

Java Maven Spring启动运行时错误(jar)

Java Maven Spring启动运行时错误(jar),java,spring,maven,spring-mvc,spring-boot,Java,Spring,Maven,Spring Mvc,Spring Boot,我是Springframework的新手,最近开始使用SpringBoot。我使用了Chris Henkel关于使用Angular js进行Sring的教程。我正在用spring boot构建同样的功能。我不断遇到这个错误: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'blogController' defined in file [C:\User

我是Springframework的新手,最近开始使用SpringBoot。我使用了Chris Henkel关于使用Angular js进行Sring的教程。我正在用spring boot构建同样的功能。我不断遇到这个错误:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'blogController' defined in file [C:\Users\arnoldnogo\IdeaProjects\FreightsMatch\target\classes\com\freightsmatch\rest\controllers\BlogController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.freightsmatch.service.BlogService]: : Error creating bean with name 'blogServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.freightsmatch.repositories.BlogEntryRepo com.freightsmatch.service.impl.BlogServiceImpl.entryRepo; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.freightsmatch.repositories.BlogEntryRepo] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blogServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.freightsmatch.repositories.BlogEntryRepo com.freightsmatch.service.impl.BlogServiceImpl.entryRepo; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.freightsmatch.repositories.BlogEntryRepo] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1131)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1034)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
at com.freightsmatch.FreightsMatchApplication.main(FreightsMatchApplication.java:20)
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:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

这不是编译错误,而是运行时错误。只有当源代码中有错误且编译器无法编译代码时,才会发生编译错误。显然,您可以编译和运行代码,但在运行时会出现错误。错误表明您没有com.freightsmatch.repositories.BlogEntryRepo类型的bean-请检查您的Spring配置,并确保您配置了此类型的bean。谢谢@Jesper,我已经对标题进行了必要的更改。它已成功运作