Monday, January 30, 2017

Troubleshooting - When an email is being sent, the following error.

The following error occurred when sending an email with Gmail SMTP from other server.
30 1월 2017;22:10:39.951 [pool-1-thread-2] ERROR o.s.a.i.SimpleAsyncUncaughtExceptionHandler.handleUncaughtException(37) - Unexpected error occurred invoking async method 'public void com.abilists.home.service.impl.HomeServiceImpl.sendEmail(com.abilists.home.bean.para.RequestPara) throws java.lang.Exception'. java.lang.RuntimeException: javax.mail.AuthenticationFailedException: 534-5.7.14 https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbsZ 534-5.7.14 xuLCEFlPwh4BIsuGE0dCKxtaRghuM_aV5ghEeqeN27jyYUG1fXnGzT9HFrAnPpQeypwXKh 534-5.7.14 OwvJp_fSk9Ram3RyxvR1lq3_sHDGn4myTJR_qRGNkcOkzpUvM9mcSoXCT6U1lmUgDNgFp2
Just click the URL on your account.
https://accounts.google.com/DisplayUnlockCaptcha

Sunday, January 29, 2017

H2 - How to make user function

I've made user function for H2.
But It didn't work as blow.
29 Jan 2017;05:25:30.778 [1719132627@qtp-715211920-0] ERROR c.a.c.c.AbstractBaseController.handleException(289) - Exception's trace:
org.springframework.jdbc.UncategorizedSQLException:
### Error updating database. Cause: org.h2.jdbc.JdbcSQLException: Function "LAST_INSERT_ID_MAX" not found; SQL statement:
UPDATE
abilists_sequence
SET
id=LAST_INSERT_ID_MAX(id+1)
WHERE
seq_name = ? [90022-191]

What cause the error is public in java.
This is the error code.
CREATE ALIAS LAST_INSERT_ID_MAX AS '

@CODE
public int lastInsertIdMax(int id) throws Exception {
return id;
}
';

What cause the error is public in java.
This is the solved code.
CREATE ALIAS LAST_INSERT_ID_MAX AS '

@CODE
int lastInsertIdMax(int id) throws Exception {
return id;
}
';