anthonyson
@anthonyson
Reviews Written
7
Average Rating
4.6
Posts
Q&A
ํ์๊ฐ์ ์ธ์ฆ ๋ฉ์ผ ํ์ธ
๋จผ์ jpa ์๋ 1์ฐจ ์บ์๊ฐ ์กด์ฌํ๋๋ฐ์ ๋์ผ transaction ์์์ ๋ฐ์ํ ์ํ์์๋ ์ฐ๊ธฐ์ง์ฐ ์ผ๋ก ์ค์ save๋ฅผ ๋ ๋ ค๋ commit ์์ ์ ๋ฐ์ดํฐ๊ฐ ์ ์ฅ๋๊ฒ ๋ฉ๋๋ค.flush๋ฅผ ์ฌ์ฉํ๊ฒ๋๋ฉด ๊ฐ์ ๋ก insert ํฉ๋๋ค. ์๋ฅผ ๋ค์ด์ em.persist(entity1) em.flushem.persist(entity2); ํ์๊ฒฝ์ฐ flush๋ฅผ ์ํ์๋๋ insert๊ฐ ๋์ค์๋์ค์ ๋๊ฐ์ง๋ง flush๋ฅผ ํ๋ฉด ๋ฐ๋ก ์คํ๋ฉ๋๋ค.์ด์ ์ฐธ๊ณ ๋ฐ๋๋๋ค.
- 0
- 2
- 483
Q&A
SecurityConfig์ WebSecurityConfigurerAdapter ๊ฐ deprecated ๋์ด ์๋์ ๊ฐ์ด ์ฝ๋๋ฅผ ์์ ํ์๋๋ฐ ๊ด์ฐฎ์๊น์?
WebSecurityConfigurerAdapter ๊ฐ deprecated๊ฐ ๋์์ต๋๋ค. ๊ด๋ จ ๋ฌธ์ ๋ ์๋์ ๊ฐ์ด ํด๊ฒฐ ํ์ค ์ ์์ต๋๋ค.private final AuthenticationService authenticationService;private final DataSource dataSource;@Beanpublic SecurityFilterChain filterChain(HttpSecurity http) throws Exception {http.authorizeHttpRequests().mvcMatchers("/", "login", "/check-email", "/check-email-token", "/email-login", "/check-email-login","/login-link","/sign-up").permitAll().mvcMatchers(HttpMethod.GET, "/profile/*").permitAll().mvcMatchers("/css/**, /js/**, /images/**").permitAll().anyRequest().authenticated(); // ๋ก๊ทธ์ธ ํด์ผ๋ง ์ ๊ทผ ๊ฐ๋ฅ http.formLogin().loginPage("/login").permitAll().defaultSuccessUrl("/");//.failureUrl("/login-error"); http.logout().logoutSuccessUrl("/");http.rememberMe().userDetailsService(authenticationService).tokenRepository(tokenRepository());return http.build();}@Beanpublic WebSecurityCustomizer webSecurityCustomizer() {return (web) -> web.ignoring().mvcMatchers("/images/**", "/favicon.ico","node_modules/**");}๋ํ๊ฐ์ง AccountService์ SecurityConfig๊ฐ ์๋ก ์์กด์ฑ์ ๊ฐ์ง๊ณ ์๊ธฐ ๋๋ฌธ์ ์ํ ์ฐธ์กฐ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค.์ด๋ด ๊ฒฝ์ฐ ๊ตฌ์กฐ์ ์ผ๋ก ๋ณ๊ฒฝ์ด ํ์ํ๋ฐ์Lazy Initialzation ์ผ๋ก ํด๊ฒฐํ ์๋ ์์ง๋ง ๊ตฌ์กฐ์ ์ผ๋ก ๋ณ๊ฒฝํ๋๊ฒ ๊ฐ์ฅ ์ข์ ๋ณด์ ๋๋ค.์ธ์ฆ๊ณผ๊ด๋ จ๋ ๋ก์ง์ ๋ณ๋์ ํด๋์ค๋ก ๋ถ๋ฆฌํ์ฌ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ์ถ์ฒ ๋๋ฆฝ๋๋ค. @Component@RequiredArgsConstructorpublic class AuthenticationService implements UserDetailsService {private final AccountRepository accountRepository;@Override public UserDetails loadUserByUsername(String emailOrNickname) throws UsernameNotFoundException {Account account = accountRepository.findByEmail(emailOrNickname);if (account == null) {account = accountRepository.findByNickname(emailOrNickname);}if ( account == null ) {throw new UsernameNotFoundException(emailOrNickname);}return new UserAccount(account);}}๋์์ด ๋์์ผ๋ฉด ์ข๊ฒ ๋ค์
- 0
- 2
- 1.1K
Q&A
vagrant up ssh ์ค๋ฅ
capturefilename="C:/Users/pagai/VirtualBox VMs/CentOS-k8s_1575181722798_23744"captureres="1024x768"capturevideorate=512capturevideofps=25captureopts="ac_enabled=false"GuestMemoryBalloon=0GuestOSType="RedHat_64"GuestAdditionsRunLevel=0DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000DEBUG subprocess: Exit status: 0ERROR warden: Error occurred: Timed out while waiting for the machine to boot. This means thatVagrant was unable to communicate with the guest machine withinthe configured ("config.vm.boot_timeout" value) time period.If you look above, you should be able to see the error(s) thatVagrant had when attempting to connect to the machine. These errorsare usually good hints as to what may be wrong.If you're using a custom box, make sure that networking is properlyworking and you're able to connect to the machine. It is a commonproblem that networking isn't setup properly in these boxes.Verify that authentication configurations are also setup properly,as well.
- 0
- 5
- 904
Q&A
vagrant up ssh ์ค๋ฅ
OVA๊ฐ ๋ญ๊ฐ์?
- 0
- 5
- 904
Q&A
vagrant up ssh ์ค๋ฅ
(์ฌ์ง)
- 0
- 5
- 904




