型Org.springframework.mail.javamail.JavaMailSender的豆找不到
下面是代码,以及如何我已经使用它。它适用于Windows没有使用Ubuntu和收到此错误
@Autowired
private JavaMailSender mailSender;
User user = userService.findByUsername(principal.getName());
Order order = orderService.createOrder(shoppingCart, shippingAddress, billingAddress, payment, shippingMethod, user);
mailSender.send(mailConstructor.constructOrderConfirmationEmail(user, order, Locale.ENGLISH));
shoppingCartService.clearShoppingCart(shoppingCart);
LocalDate today = LocalDate.now();
LocalDate estimatedDeliveryDate;
***************************
APPLICATION FAILED TO START
***************************
Description:
Field mailSender in com.bookstore.controller.CheckoutController required a bean of type 'org.springframework.mail.javamail.JavaMailSender' that could not be found.
- Bean method 'mailSender' not loaded because AnyNestedCondition 0 matched 2 did not; NestedCondition on MailSenderAutoConfiguration.MailSenderCondition.JndiNameProperty @ConditionalOnProperty (spring.mail.jndi-name) did not find property 'jndi-name'; NestedCondition on MailSenderAutoConfiguration.MailSenderCondition.HostProperty @ConditionalOnProperty (spring.mail.host) did not find property 'host'
Action:
Consider revisiting the conditions above or defining a bean of type 'org.springframework.mail.javamail.JavaMailSender' in your configuration.
我认为它具有抗病毒的事,在窗户我不得不解散能抗病毒,但Ubuntu的我该怎么办?
2017-10-15
valik
+0
您是否移动了每个文件?你能发布有用的代码吗?事实上,这不可能帮助你解决问题。 –