第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

啟動(dòng)之后,一直報(bào)空指針異常

sendMessageTest(com.neo.helloWord.service.ServiceTest)? Time elapsed: 0.026 sec? <<< ERROR!

java.lang.NullPointerException: null

at com.neo.helloWord.hello.MailService.sendSimpleMail(MailService.java:34)

at com.neo.helloWord.service.ServiceTest.sendMessageTest(ServiceTest.java:26)


2019-04-03 16:06:14.461? INFO 5236 --- [? ? ? ?Thread-2] o.s.w.c.s.GenericWebApplicationContext? ?: Closing org.springframework.web.context.support.GenericWebApplicationContext@26275bef: startup date [Wed Apr 03 16:06:10 CST 2019]; root of context hierarchy


Results :


Tests in error:?

? ServiceTest.sendMessageTest:26 ? NullPointer


正在回答

3 回答

請(qǐng)問(wèn)這個(gè)問(wèn)題解決了嗎

java.lang.NullPointerException

報(bào)的是這個(gè)錯(cuò)誤,下面是代碼內(nèi)容

try{
????Hello?h?=?new?Hello();
????h.SimpleEmail("shizengs@aliyun.com",?"This?is?Subject",?"This?is?Content");
}catch?(Exception?e){
????System.out.println(e);
}


@RestController
public?class?Hello?{
????@Value("${spring.mail.username}")
????private?String?from;

????@Autowired
????private?JavaMailSender?mailSender;

????@RequestMapping(value="/sendEmail",?method?=?RequestMethod.GET)
????public?void?SimpleEmail(String?to,?String?subject,?String?content){
????????SimpleMailMessage?simpleMailMessage?=?new?SimpleMailMessage();
????????simpleMailMessage.setTo(to);
????????simpleMailMessage.setSubject(subject);
????????simpleMailMessage.setText(content);
????????simpleMailMessage.setFrom(from);
????????mailSender.send(simpleMailMessage);
????}

}


0 回復(fù) 有任何疑惑可以回復(fù)我~

我也遇到了,請(qǐng)問(wèn)你是怎么解決的


0 回復(fù) 有任何疑惑可以回復(fù)我~

spring boot實(shí)現(xiàn)郵箱驗(yàn)證碼注冊(cè)


https://blog.csdn.net/IndexMan/article/details/89409512


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

啟動(dòng)之后,一直報(bào)空指針異常

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)