| 스프링부트(Spring Boot) HTTPS 구축 스프링부트에서 HTTPS 설정법은 다음과 같습니다. Terminal 창에 다음과 같이 커맨드를 입력하여 keystore 파일을 하나 생성합니다. keytool -genkey -alias spring -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 4000 application.properties에 위에서 설정한 정보를 입력합니다. 위 https로 설정된 스프링 부트 어플리케이션에 http://localhost:8080/ 로 요청했을 경우에는 요청을 받지 않는다는 브라우져 메세지가 뜨게 됩니다. 그렇다면 https 프로토콜로 위와 같은 요청을 했을 경우(https:..
아래의 오류의 경우 해결 방법은 1월 20, 2020 2:53:09 오전 org.apache.catalina.core.StandardService startInternal 정보: Starting service [Tomcat] 1월 20, 2020 2:53:09 오전 org.apache.catalina.core.StandardEngine startInternal 정보: Starting Servlet engine: [Apache Tomcat/9.0.30] 1월 20, 2020 2:53:09 오전 org.apache.catalina.core.ContainerBase startInternal 심각: A child container failed during start java.util.concurrent.Exec..
| 사용자(Custom) Autoconfigure 클래스 선언의 문제점 @Configuration 어노테이션을 등록하여 Autoconfigure 스프링 부트 자동 설정을 만들었지만 여기에 문제점이 있습니다. @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication application = new SpringApplication(Application.class); application.setWebApplicationType(WebApplicationType.NONE); application.run(args); } @Bean public Saelobi saelobi(){ ..
스프링 부트 자동 설정 이해 스프링 부트는 스프링 프레임워크에서 어플리케이션을 만들 때 주로 사용하는 설정들을 자동으로 설정합니다. 이 기능은 자바의 main 진입점에 @SpringBootApplication을 붙임으로서 사용할 수 있습니다. @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication application = new SpringApplication(Application.class); application.run(args); } } @Configuration @ComponentScan @EnableAutoConfiguration public class Ap..
*************************** APPLICATION FAILED TO START *************************** Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have data..
| 스프링 부트 의존성 관리 (Spring Boot Dependency Management) 스프링 부트는 Maven, Gradle 같은 빌드 관리 툴을 통해 의존성을 관리합니다. 여기서는 Maven 기준으로 스프링 부트가 의존성을 어떻게 관리하는 지 살펴보도록 하겠습니다. pom.xml 에 스프링 부트에 대한 기본적인 의존성을 추가하면 다음과 같습니다. org.springframework.boot spring-boot-starter-parent 2.1.1.RELEASE org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-test test 다음과 같이 의존성을 추가하면 스프링 부트가 자체적..
@Service public class AppRunner implements ApplicationRunner { @Autowired EventService eventService; @Override public void run(ApplicationArguments args) throws Exception { eventService.createEvent(); eventService.publishEvent(); eventService.deleteEvent(); } } 스프링 AOP ( Aspect Oriented Programming ) AOP는 Aspect Oriented Programming의 약자로 관점 지향 프로그래밍이라고 불린다. 관점 지향은 쉽게 말해 어떤 로직을 기준으로 핵심적인 관점, 부가적인..
| 스프링 Expression Language : SpEL ● 객체 그래프를 조회하고 조작하는 기능을 제공한다. ● Unified EL과 비슷하지만, 메소드 호출을 지원하며, 문자열 템플릿 기능도 제공한다. ● OGNL, MVEL, JBOss EL 등 자바에서 사용할 수 있는 여러 EL이 있지만, SpEL은 모든 스프링 프로젝트 전반에 걸쳐 사용할 EL로 만들었다. ● 스프링 3.0 부터 지원한다. SpEL 구성 ● ExpressionParser parser = new SpelExpressionParser() ● StandardEvaluationContext context = new StandardEvaluationContext(bean) ● Expression expression = parser.par..