1 Abnormal description
After checking out the project from SVN and configuring it, start the Tomcat server and report the following error:
2 Abnormal Causes
By observing the abnormal information marked in the figure above, we can know
Org. Springframework. Beans. Factory. BeanCreationException: Error creating bean with the name ‘XXX’
This exception is: Injection bean failed exception.
To put it bluntly, if this exception occurs, the corresponding bean cannot be found! The reasons why bean injection can fail include but are not limited to the following:
The corresponding bean is not annotated; @service
stead of dubbo; Select the wrong automatic injection method, etc.
3 Solutions
Now that we know the cause of this exception, we look back at the corresponding Bean declaration and see that the code that injected the Facade is:
@Autowired
ErrorCodeFacade errorCodeFacade;
Well, here’s the mistake! In general, when injecting interfaces at the Service and Biz layer, you can use @Autowired
for example:
@Autowired
ErrorCodeService errorCodeService;
But, when injected into the Facade layer interface, should use the RemoteServiceFactory. GetService () code>, such as:
ErrorCodeFacade errorCodeFacade = RemoteServiceFactory.getService(ErrorCodeFacade.class);
That is, the exception is resolved by declaring the ErrorCodeFacade with the code above.
Warm prompt: there are many reasons for this exception, the above only lists the problems I encountered and solutions, I hope to be helpful to you!
Read More:
- Caused by: org.springframework.beans.factory.beancreationexception: error creating be
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘serviceImpl‘
- Spring configuration error: org.springframework.beans . factory.BeanCreationException : Error creating bean with name ‘m
- Error in project operation org.springframework.beans . factory.BeanCreationException : error creating bean with name can be configured by
- org.springframework.beans.factory.UnsatisfiedDependencyException
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘use
- shiro Error org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type
- Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of ty
- Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException
- Org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: the wildcard matching is comprehensive, but the declaration of element XX: XX XX cannot be found
- Unable to read Scheme Document ‘ http://www.springframework.org/schema/beans/spring-beans-4.1.xsd ‘ [How to Fix]
- Image file upload error org.springframework.beans .ConversionNotSupportedException
- Solve the previous one bean.xml “Error while downloading” in < bean > tag http://www.springframework.org/schema/beans/sprin…
- MySQL driver compiling method of QT under windows and solutions to abnormal errors
- Kafka connection abnormal org.apache.kafka . common.errors.TimeoutException : Failed to update metadata after 60000 ms.
- Spring nested exception is java.lang.NoClassDefFoundError: org/springframework/core/MethodClassKey
- Spring Cloud:org.springframework.web.client.HttpClientErrorException: 404 null
- Cannot resolve plugin org.springframework .boot:xxx
- NoClassDefFoundError: org.springframework.validation.annotation.ValidationAnnotationUtils