Spring-boot 2.3.0.M4 JDK 11 Интегрированное исключение NoSuchBeanDefinitionException ... ConfigurationClassPostProcessor, ... ProxyTransactionManagementConfiguration - PullRequest
1 голос
/ 15 апреля 2020

Я объявляю spring-boot Spring-boot 2.3.0.M4 и JDK 11 в моем проекте, но я получаю исключение NoSuchBeanDefinitionException для ... ConfigurationClassPostProcessor и Ошибка создания бина с именем ... ProxyTransactionManagementConfiguration Вот трассировка стека:

 at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]

...

 at com.main(EcApplication.java:24) ~[classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mailSender' defined in class path resource [org/springframework/boot/autoconfigure/mail/MailSenderPropertiesConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.mail.javamail.JavaMailSenderImpl]: Factory method 'mailSender' threw exception; nested exception is java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport
 at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:656) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]

...

org.springframework.mail.javamail.ConfigurableMimeFileTypeMap.createFileTypeMap(ConfigurableMimeFileTypeMap.java:151) ~[spring-context-support-5.2.5.RELEASE.jar:5.2.5.RELEASE]
 at
...
org.springframework.boot.autoconfigure.mail.MailSenderPropertiesConfiguration.mailSender(MailSenderPropertiesConfiguration.java:44) ~[spring-boot-autoconfigure-2.3.0.M4.jar:2.3.0.M4]
 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
 at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
 at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'delegatingApplicationListener' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available
 at 
...
 at com.main(EcApplication.java:24) ~[classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available
 at ...
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
 ... 38 common frames omitted   ```




I searched and found it is not **@Autowire**  is not creating bean but nothing helped.



 @RestController
 public class CheckoutResource { 
     @Autowired
     private JavaMailSender mailSender;
 }

Can anyone help me? Thanks!

1 Ответ

0 голосов
/ 16 апреля 2020

Это чисто автоматическая проблема, т. Е. Класс отправителя почты не найден во время работы приложения, убедитесь, что вы используете правильную версию java в вашем ide.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...