Ich habe gerade mein Projekt von Windows auf Ubuntu verschoben. Unter Windows läuft das Programm in Ordnung, aber ich habe diesen Fehler in Ubuntu:Bean vom Typ Org.springframework.mail.javamail.JavaMailSender konnte nicht gefunden werden?
Bean vom Typ Org.springframework.mail.javamail.JavaMailSender nicht
Sie den Code unten ist und wie ich gefunden werden konnte habe es benutzt. und es funktioniert auf Windows nicht mit Ubuntu und bekommt diesen Fehler
@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.
Ich denke, es hat mit Anti-Virus zu tun, in den Fenstern i zu dis Lage Anti-Virus hatte aber Ubuntu, was soll ich tun?
Haben Sie jede Datei verschoben? Kannst du hilfreiche Codes schreiben? So wie es ist, ist es unmöglich, Ihnen zu helfen, das Problem zu lösen. – araknoid