본문 바로가기

728x90

Spring

(15)
Mircro Service Architecture 구현 1. 어플리케이션 클래스에 등록@EnableFeignClients@SpringBootApplication@ComponentScan(basePackages = "com.osm.erp"public class OsmApplication { public static void main(String[] args) { SpringApplication.run(OsmApplication.class, args); }} 2. config.yml 에 등록 feignclient: url: apigw: http://dev-apigw-init.sm.com:7880 apikey: pay: xxx-xxx-xxx payreceive: yyy-yyy-yyy 3. FeignConfig.java im..
yml 프로필 활성화 1. application.yml 설정 이해spring: application: name: spring-batch profiles: dev # 기본적으로 dev 환경 활성화 group: "default": "common, default" "dev" : "common, dev # dev 파일이 활성화되면 + common 파일도 함께 활성화가 된다. spring: config: activate: on-profile: dev #dev(개발)환경 활성화 import: - classspath:config/dev/config.yml #기본적으로 2.docker-compose.yml 설정services: mysql: container-name:..
Unable to proxy interface-implenting method 에러1. Unable to proxy interface-implementing method [public final void org.springframework.dao.support.DaoSupport.afterPropertiesSet() throws java.lang.IllegalArgumentException,org.springframework.beans.factory.BeanInitializationException] because it is marked as final:Consider using interface-based JDK proxies insteadafterPropertiesSet 메서드가 final 메서드 이기 때문에 '프록싱'할 수 없다!즉,  전통적인 JDBC 기반 데이터 액세스 로..
stream api 의 이해 import java.util.Arrays;import java.util.List;import java.util.stream.Collectors;public class StreamExample { public static void main(String[] args) { List names = Arrays.asList("Alice", "Bob", "Charlie", "David"); // 스트림을 사용하여 이름 필터링 및 변환 List result = names.stream() .filter(name -> name.startsWith("A")) // 'A'로 시작하는 이름 필터링 (중간 연산) ..
자바의 MultiValueMap 자료형 MultiValueMap는 키와 그에 연결된 값들의 리스트로 이루어져 있으므로, 내부적으로는 아래와 같은 형태로 저장됩니다.{ "cid": ["TC0ONETIME"], "partner_order_id": ["KA2020338445"], "partner_user_id": ["kakaopayTest"], "item_name": ["params에서 가져온 값"], "quantity": ["params에서 가져온 값"], "total_amount": ["params에서 가져온 값"], "tax_free_amount": ["params에서 가져온 값"], "approval_url": ["http://localhost:83/pay/success"], "cancel_url": ["http://loca..
웹 소켓 설정 1. pom.xml에 참조  org.springframework.boot spring-boot-starter-websocket  2. 첫 에러 -> WebSocketConfigurer.class 가 없다. -Caused by: java.io.FileNotFoundException: class path resource [org/springframework/web/socket/config/annotation/WebSocketConfigurer.class] cannot be opened because it does not exist의미 : org.springframework.web.socket.config.annotation 패키지 안에 저 클래스가 없다.원인: maven update ->  ..
403 에러 1. 문제 현상POST http://192.168.0.101:8088/api/send-mail/email 403 (Forbidden) 와 xhr.js:186                       POST http://192.168.0.101:8088/api/send-mail/email 403 (Forbidden)    2. 문제 원인은 바로! 서버 측 권한 설정 문제CORS 문제 해결처음에는 allowedOrigins가 localhost:8080으로만 되어 있었다 그래서 ip주소가 다른 로컬 호스트일 경우 CORS 문제가 발생한다는 것을 인지! 그래서 전체로 변경!
smtp 설정 및 설치 1. application.yml 설정spring: mail: host: smtp.gmail.com port: 587 username: bangbae #bangbae@naver.com password: # 앱 비밀번호는 구글 계정, 16자리 설정 properties: mail: smtp: auth: true timeout : 5000 starttls: enable: true 2. 계정관리 - 보안 - 앱 비밀번호 검색3. 생성된 앱 비밀번호 - 구글 계정 설정 4. 구글 메일 설정 1)Gmail (모든)설정에 들어가서 전달 및 POP/IMAP 탭으로 들어간다.2)모..
JRE System 설정 위치: 프로젝트 오른쪽 마우스 - Properties - Libraries - Edit 프로젝트는 시스템의 기본 JRE  17버전을  삿용, 특정 요구사항이 있을 때 "Alternate JRE" 8버전을 사용하도록 설정
@Transactionalvalue의 propagation= Propagation.REQUIRED package com.shoppingmall.post;import java.io.File;import java.io.IOException;import java.text.SimpleDateFormat;import java.util.ArrayList;import java.util.Date;import java.util.HashMap;import java.util.List;import java.util.Map;import java.util.UUID;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.w..

728x90